Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package.json file missing [error: ENOLOCAL] #640

Closed
assumer opened this issue Aug 8, 2017 · 24 comments
Closed

Package.json file missing [error: ENOLOCAL] #640

assumer opened this issue Aug 8, 2017 · 24 comments

Comments

@assumer
Copy link

assumer commented Aug 8, 2017

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 npm@5.3.0
3 info using node@v8.2.1
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 ]

@daffl
Copy link
Member

daffl commented Aug 8, 2017

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.

@daffl daffl closed this as completed Aug 10, 2017
@himajaM
Copy link

himajaM commented Nov 22, 2017

Deleting package-lock.json solved for me.

@mj6uc
Copy link

mj6uc commented Jun 5, 2018

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

@ismatoro
Copy link

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@...

@bertho-zero
Copy link
Collaborator

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.

@batatop
Copy link

batatop commented Sep 8, 2018

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.

@bertho-zero
Copy link
Collaborator

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.

@Lukenickerson
Copy link

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.

@arunvisvajeetrs
Copy link

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 :)

@yamidnozu
Copy link

yamidnozu commented Jul 25, 2019

npm i create-react-app -g

After
npx create-react-app myApp

@pablofaalves
Copy link

npm i create-react-app -g

After
npx create-react-app myApp

This one worked for me...

@marcusyoda
Copy link

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!

@MartinDM
Copy link

MartinDM commented Oct 18, 2019

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

@markus-weiss
Copy link

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

@SanGamkalRa
Copy link

npm i create-react-app -g

After
npx create-react-app myApp

thanks alot.

@Adityac1
Copy link

npm i create-react-app -g

This worked for me

@ghost
Copy link

ghost commented May 21, 2020

npm install

I just run the command again and work!

@TobinXu
Copy link

TobinXu commented Jun 28, 2020

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

@mrswizrd
Copy link

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.

@khrome-cape
Copy link

khrome-cape commented Sep 29, 2020

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...

@valsydev
Copy link

valsydev commented Dec 1, 2020

npm install -g create-react-app

@abdullahalmamun17
Copy link

npm i create-react-app -g

After
npx create-react-app myApp

worked for me

@Ankita123-git
Copy link

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

@albiummid
Copy link

npm i create-react-app -g

After
npx create-react-app myApp

this one worked for me.

@feathersjs feathersjs locked as resolved and limited conversation to collaborators Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests