Feathers: Package.json file missing [error: ENOLOCAL]

Created on 8 Aug 2017  ·  24Comments  ·  Source: feathersjs/feathers

I was trying to generate an app from feathers generate app
but after the initial inputs it produced this below error log ...
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'eslint',
1 verbose cli 'mocha',
1 verbose cli 'request',
1 verbose cli 'request-promise',
1 verbose cli '--save-dev',
1 verbose cli '--cache-min',
1 verbose cli '86400' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session ee4bff913200d922
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/eslint 96ms (from cache)
8 http fetch GET 200 https://registry.npmjs.org/request-promise 101ms (from cache)
9 silly pacote tag manifest for eslint@latest fetched in 175ms
10 http fetch GET 200 https://registry.npmjs.org/request 133ms (from cache)
11 http fetch GET 200 https://registry.npmjs.org/mocha 162ms (from cache)
12 silly pacote tag manifest for request-promise@latest fetched in 171ms
13 silly pacote tag manifest for mocha@latest fetched in 175ms
14 silly pacote tag manifest for request@latest fetched in 199ms
15 silly install loadIdealTree
16 silly install cloneCurrentTreeToIdealTree
17 silly install loadShrinkwrap
18 silly fetchPackageMetaData error for feathers@file:feathers Could not install from "feathers" as it does not contain a package.json file.
19 verbose stack Error: ENOENT: no such file or directory, open 'e:\nodeapp\feat\feathers\package.json'
20 verbose cwd e:\nodeapp\feat
21 verbose Windows_NT 10.0.10586
22 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "eslint" "mocha" "request" "request-promise" "--save-dev" "--cache-min" "86400"
23 verbose node v8.2.1
24 verbose npm v5.3.0
25 error code ENOLOCAL
26 error Could not install from "feathers" as it does not contain a package.json file.
27 verbose exit [ 1, true ]

Most helpful comment

Deleting package-lock.json solved for me.

All 24 comments

What is the command and the dependency? From the error message it looks like it is trying to install the package from a file instead of the registry.

Deleting package-lock.json solved for me.

Also had to delete app package.json to get this to work fully.
and then added platforms again.

Have you checked the protocol of your command??

I had the same issue and if you include ssh/https, the command works.

npm install ssh://git@...

Someone can try npm cache verify ? or npm cache clean --force ?
(from https://stackoverflow.com/questions/48143945/err-code-enolocal-npm-err-could-not-install-from)

@daffl This issue appears with the command feathers generate app for @assumer.

I solved my problem using yarn install instead of npm install. If that doesn't work, you can try deleting package-lock.json and try the same thing.

Yarn is actually more suitable for monorepos, with the workspace mode enabled it is perfect to be used with lerna.

There should be a choice between npm and yarn for the generators.

I solved an "ENOLOCAL" error I was running into by adding git+ssh:// to the front of the private repo URL in the package.json dependencies.

I updated the package-lock.json by running npm install again.. and it worked for me. The package which was throwing the error was updated :)

npm i create-react-app -g

After
npx create-react-app myApp

npm i create-react-app -g

After
npx create-react-app myApp

This one worked for me...

Deleting package-lock.json solved for me.

solved for me too. The problem happened after installing the packages on Windows and committing package-lock.json. From there it did not install in linux anymore!

Another thing to check here is to look at the logs to see the path npm is looking in.

In my case, the local path specified (file:../lib) was being appended onto a linked module path.

Lesson is to ensure you're npm unlinking any previously-linked module directories which may be upsetting where you tell npm to find the modules

Hey guys,

i worked with webStrom and node.js/npm on a WebApp-project. I got the same Error

Package.json file missing [error: ENOLOCAL]

also in my projectfolder the package.json is there.

Now I found a solution. In the package.json is the following code:

"serve": "../node_modules/.bin/vue-cli-service serve",
"build": "../node_modules/.bin/vue-cli-service build"

but if the package.json is on the same hierarchical level it has to be like so:

"serve": "node_modules/.bin/vue-cli-service serve",
"build": "node_modules/.bin/vue-cli-service build"

best regards,

Markus

npm i create-react-app -g

After
npx create-react-app myApp

thanks alot.

npm i create-react-app -g

This worked for me

npm install

I just run the command again and work!

err:Could not install from "@\api\modules\product\goods-spec\goods-spec" as it does not contain a package.json file.

solution:
1、npm rm -r package-lock.json
2、npm install yarn
3、yarn add @/api/modules/product/goods-spec/goods-spec

Ensure the package.json file is in the public folder, not inside a subfolder. This was my issue and it resolved after moving it from src into public.

My issue was a github: url inside the package-lock, removing that module from the package-lock allowed me to proceed. The previous solutions would not work because my range indicators on my dependencies are too loose and a full reinstall without a package lock, unfortunately, would take either sorting the strict deps by hand or upgrading some components. Neither of which are in the cards this second. a quick edit to package-lock.json got me sorted. I'm unsure how all the broken features in package lock('link'ing, source urls, etc) has been a net win over basic shrinkwrap...

npm install -g create-react-app

npm i create-react-app -g

After
npx create-react-app myApp

worked for me

step 1: npm init
step 2: npm i npm-install-all -g
step 3: npm-install-all Run this command & installed all modules

npm i create-react-app -g

After
npx create-react-app myApp

this one worked for me.

Was this page helpful?
0 / 5 - 0 ratings