How to give mkdir permission for npx command - npm

I have problem using npx create-react-app command
Earlier I had create-react-app installed globally on and system and used npm create-react-app command
But I learned that using npx we will always use the latest version and to use npx I have uninstalled create-react-app from my system
Whenever I try to run npx create-react-app my-app command
I get the following error:
C:\Users\Sachin Verma\Desktop\react-project>npx create-react-app tut
Error: EPERM: operation not permitted, mkdir 'C:\Users\Sachin'
command not found: create-react-app
But if I install create-react-app on my system globally, then npx command works
I tried cleaning npm cache and also reinstalled node.js but the problem still exists
Edit:
When running CMD in administrator rights
Microsoft Windows [Version 10.0.19042.685]
(c) 2020 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>cd C:\Users\Sachin Verma\Desktop\react-project\
C:\Users\Sachin Verma\Desktop\react-project>npx create-react-app tutt
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Verma\AppData\Roaming\npm-cache\_npx\14832" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sachin Verma\AppData\Roaming\npm-cache\_logs\2021-01-11T15_27_28_701Z-debug.log
Install for [ 'create-react-app#latest' ] failed with code 1
Content of log file:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Sachin Verma\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'create-react-app#latest',
1 verbose cli '--global',
1 verbose cli '--prefix',
1 verbose cli 'C:\\Users\\Sachin',
1 verbose cli 'Verma\\AppData\\Roaming\\npm-cache\\_npx\\14832',
1 verbose cli '--loglevel',
1 verbose cli 'error',
1 verbose cli '--json'
1 verbose cli ]
2 info using npm#6.14.11
3 info using node#v15.5.1
4 verbose npm-session 5f8e13bb496752c5
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for file:Verma\AppData\Roaming\npm-cache\_npx\14832 Could not install from "Verma\AppData\Roaming\npm-cache\_npx\14832" as it does not contain a package.json file.
8 http fetch GET 304 https://registry.npmjs.org/create-react-app 2907ms (from cache)
9 silly pacote tag manifest for create-react-app#latest fetched in 2943ms
10 timing stage:rollbackFailedOptional Completed in 2ms
11 timing stage:runTopLevelLifecycles Completed in 2957ms
12 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\Sachin Verma\Desktop\react-project\Verma\AppData\Roaming\npm-cache\_npx\14832\package.json'
13 verbose cwd C:\Users\Sachin Verma\Desktop\react-project
14 verbose Windows_NT 10.0.19042
15 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Sachin Verma\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app#latest" "--global" "--prefix" "C:\\Users\\Sachin" "Verma\\AppData\\Roaming\\npm-cache\\_npx\\14832" "--loglevel" "error" "--json"
16 verbose node v15.5.1
17 verbose npm v6.14.11
18 error code ENOLOCAL
19 error Could not install from "Verma\AppData\Roaming\npm-cache\_npx\14832" as it does not contain a package.json file.
20 verbose exit [ 1, true ]
Is there any problem due to my username because it contains a space in between?

Try to run your CMD in administration or you can change your working dir, where no admin privilege is required.

Related

why npm-audit fails for react-native-unimodule

I am trying to run npm audit on my react-native project which originally was an expo project and ejected to bare workflow. When I run npm audit, I get
npm ERR! code ELOCKVERIFY
npm ERR! Errors were found in your package-lock.json, run npm install to fix them.
npm ERR! Invalid: lock file's react-native-unimodules#0.9.1 does not satisfy react-native-unimodules#^0.7.0
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kislam/.npm/_logs/2020-06-04T04_13_14_375Z-debug.log
the detail log is as follows
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/Users/kislam/.nvm/versions/node/v12.14.0/bin/node',
1 verbose cli '/Users/kislam/.nvm/versions/node/v12.14.0/bin/npm',
1 verbose cli 'audit'
1 verbose cli ]
2 info using npm#6.14.5
3 info using node#v12.14.0
4 verbose npm-session bcb02cea1f031e3c
5 verbose stack Error: Errors were found in your package-lock.json, run npm install to fix them.
5 verbose stack Invalid: lock file's react-native-unimodules#0.9.1 does not satisfy react-native-unimodules#^0.7.0
5 verbose stack at /Users/kislam/.nvm/versions/node/v12.14.0/lib/node_modules/npm/lib/audit.js:184:19
6 verbose cwd /Users/kislam/bunnings/repos/trades-mobile-app
7 verbose Darwin 19.4.0
8 verbose argv "/Users/kislam/.nvm/versions/node/v12.14.0/bin/node" "/Users/kislam/.nvm/versions/node/v12.14.0/bin/npm" "audit"
9 verbose node v12.14.0
10 verbose npm v6.14.5
11 error code ELOCKVERIFY
12 error Errors were found in your package-lock.json, run npm install to fix them.
12 error Invalid: lock file's react-native-unimodules#0.9.1 does not satisfy react-native-unimodules#^0.7.0
13 verbose exit [ 1, true ]
The package.json has the following associated versions
"expo": "~37.0.3",
"react-native": "~0.61.4",
"react-native-unimodules": "~0.9.0",
Cannot figure out where npm-audit is getting react-native-unimodules#^0.7.0 from.

I can't install dependencies for React Native Projects correctly

So I tried running a React Native project in my android emulator using Expo, but every time I install someone else's project, I'm not able to run it.
This is how I install the project along with its dependencies:
> git clone https://github.com/nabendu82/NativeRestaurantSearc.git
> cd NativeRestaurantSearc
> npm install
> npm start
When I run all this, I recieve this error message:
error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class.
Metro Bundler process exited with code 1
Set EXPO_DEBUG=true in your env to view the stack trace.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Yassi\AppData\Roaming\npm-cache\_logs\2020-04-18T10_46_25_411Z-debug.log
This is a complete log of the run:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Yassi\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.13.6
3 info using node#v12.16.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle #~prestart: #
6 info lifecycle #~start: #
7 verbose lifecycle #~start: unsafe-perm in lifecycle true
8 verbose lifecycle #~start: PATH: C:\Users\Yassi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Yassi\Bureaublad\React Native\NativeRestaurantSearc\node_modules\.bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Users\Yassi\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files (x86)\Yarn\bin\;C:\Program Files (x86)\Graphviz2.38\bin\dot.exe;C:\Users\Yassi\AppData\Local\Continuum\anaconda3;C:\Users\Yassi\Ap;C:\Program Files\nodejs\;C:\Users\Yassi\AppData\Local\Continuum\anaconda3;C:\Users\Yassi\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin;C:\Users\Yassi\AppData\Local\Continuum\anaconda3\Library\usr\bin;C:\Users\Yassi\AppData\Local\Continuum\anaconda3\Library\bin;C:\Users\Yassi\AppData\Local\Continuum\anaconda3\Scripts;C:\Users\Yassi\AppData\Local\Microsoft\WindowsApps;C:\Users\Yassi\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Yassi\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\Yassi\AppData\Local\Yarn\bin;C:\Users\Yassi\AppData\Local\Continuum\anaconda3\Library\bin\graphviz;C:\Users\Yassi\Documents\stardog-7.0.1;C:\Users\Yassi\AppData\Roaming\npm
9 verbose lifecycle #~start: CWD: C:\Users\Yassi\Bureaublad\React Native\NativeRestaurantSearc
10 silly lifecycle #~start: Args: [ '/d /s /c', 'expo start' ]
11 silly lifecycle #~start: Returned: code: 1 signal: null
12 info lifecycle #~start: Failed to exec start script
13 verbose stack Error: # start: `expo start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Yassi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:311:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Yassi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:311:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid #
15 verbose cwd C:\Users\Yassi\Bureaublad\React Native\NativeRestaurantSearc
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Yassi\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.16.1
19 verbose npm v6.13.6
20 error code ELIFECYCLE
21 error errno 1
22 error # start: `expo start`
22 error Exit status 1
23 error Failed at the # start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I think this has to do with npm not installing the dependencies correctly. There must be going something wrong when I do this, because this is the message I recieve when I run npm install:
added 809 packages from 438 contributors and audited 37723 packages in 119.347s
found 1072 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
What can I do to fix this? I tried reinstalling npm but that doesn't work.

Getting error "botium-cli is not recognized as an internal or external command, operable program or batch file"

I have a project in WebStorm with botium tests. My developer has helped me open the project and the configuration for test:botium:local. When I press the run for test:botium:local, I should get the results of botium tests. I am on Windows 10.
Instead I get this output:
"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" run test:botium:local --scripts-prepend-node-path=auto
> chatbot-backend#1.0.0 test:botium:local C:\Users\julie\Botium\<my repo>
> botium-cli run --config botium.local.json --convos botium/convos
'botium-cli' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! chatbot-backend#1.0.0 test:botium:local: `botium-cli run --config botium.local.json --convos botium/convos `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chatbot-backend#1.0.0 test:botium:local script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\julie\AppData\Roaming\npm-cache\_logs\2019-08-29T23_17_10_452Z-debug.log
Process finished with exit code 1
In my system environment variables, under edit environment variable, I have C:\Program Files\nodejs\
If I type npm -v in my terminal, I see that it's on 6.4.16.4.1
If I type botium-cli -V in my terminal, I get 'botium-cli' is not recognized as an internal or external command, operable program or batch file
If I reinstall through npm install -g botium-cli on my terminal, it appears to download again and says botium-cli##0.0.53 at the end, updated 1 package
If I go to My C:\users\julie\AppData\Roaming\npm\node_modules there is a botium-cli folder
If I open my command line, by default I'm in Program Files\nodejs and if I type botium-cli -V I get back 0.0.530.0.53
If I navigate to the Users/julie/Botium folder where my project is and type botium-cli -V, I get back the not recognized error even though I can download it there on powershell
The edit configuration script is: "test:botium:local": "./botiumChangeConfigUrls.sh botium.json botium.local.json && botium-cli run --config botium.local.json --convos botium/convos ",
I've rebooted my PC
I've looked all over stack overflow and google
Here is the log file mentioned in the terminal:
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 'run',
1 verbose cli 'test:botium:local',
1 verbose cli '--scripts-prepend-node-path=auto' ]
2 info using npm#6.4.1
3 info using node#v10.11.0
4 verbose run-script [ 'pretest:botium:local',
4 verbose run-script 'test:botium:local',
4 verbose run-script 'posttest:botium:local' ]
5 info lifecycle chatbot-backend#1.0.0~pretest:botium:local: chatbot-backend#1.0.0
6 info lifecycle chatbot-backend#1.0.0~test:botium:local: chatbot-backend#1.0.0
7 verbose lifecycle chatbot-backend#1.0.0~test:botium:local: unsafe-perm in lifecycle true
8 verbose lifecycle chatbot-backend#1.0.0~test:botium:local: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\julie\Botium\chatbot-poc\node_modules\.bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;C:\app\julie\virtual\product\12.2.0\dbhome_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Users\julie\AppData\Local\Android\Sdk\tools\bin;C:\Users\julie\AppData\Local\Android\Sdk\tools;C:\Users\julie\AppData\Local\Android\Sdk\platform-tools;C:\Program Files (x86)\PICT\;C:\Program Files\Java\jdk1.8.0_171\bin;C:\Maven\apache-maven-3.6.1\bin;C:\Python27;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Users\julie\ApacheJmeter\apache-jmeter-5.0\bin;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Users\julie\AppData\Local\Android\Sdk\tools\bin;C:\Users\julie\AppData\Local\Android\Sdk\tools;C:\Users\julie\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\Git\cmd;C:\Program Files (x86)\PICT\;C:\Program Files\Java\jdk1.8.0_171\bin;C:\Maven\apache-maven-3.5.4-bin\apache-maven-3.5.4\bin;C:\Python27;C:\Ruby24-x64\bin;C:\Users\julie\AppData\Local\GitHubDesktop\bin;C:\Users\julie\AppData\Local\Microsoft\WindowsApps;C:\Users\julie\AppData\Local\atom\bin;C:\Users\julie\eclipse-workspace\SceneBuilder\jtds\jtds-1.3.1.jar;;C:\Users\julie\AppData\Local\Microsoft\WindowsApps;C:\Users\julie\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle chatbot-backend#1.0.0~test:botium:local: CWD: C:\Users\julie\Botium\chatbot-poc
10 silly lifecycle chatbot-backend#1.0.0~test:botium:local: Args: [ '/d /s /c',
10 silly lifecycle 'botium-cli run --config botium.local.json --convos botium/convos ' ]
11 silly lifecycle chatbot-backend#1.0.0~test:botium:local: Returned: code: 1 signal: null
12 info lifecycle chatbot-backend#1.0.0~test:botium:local: Failed to exec test:botium:local script
13 verbose stack Error: chatbot-backend#1.0.0 test:botium:local: `botium-cli run --config botium.local.json --convos botium/convos `
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid chatbot-backend#1.0.0
15 verbose cwd C:\Users\julie\Botium\chatbot-poc
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test:botium:local" "--scripts-prepend-node-path=auto"
18 verbose node v10.11.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error chatbot-backend#1.0.0 test:botium:local: `botium-cli run --config botium.local.json --convos botium/convos `
22 error Exit status 1
23 error Failed at the chatbot-backend#1.0.0 test:botium:local script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
In case it helps anyone, I re-ran an npm install and then npm run in the folder where my project was seemed to fix the issue
Add C:\users\julie\AppData\Roaming\npm to your %PATH% environment variable.

Cannot run npm run serve

I created a client project for vue and run npm run serve,
but got this error:
Tried to reinstall node,npm, edited some PATHS, but nothing worked
Version
3.2.1
Node and OS info
Node v10.14.0/ npm 6.4.1
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'serve' ]
2 info using npm#6.4.1
3 info using node#v10.14.0
4 verbose run-script [ 'preserve', 'serve', 'postserve' ]
5 info lifecycle client#0.1.0~preserve: client#0.1.0
6 info lifecycle client#0.1.0~serve: client#0.1.0
7 verbose lifecycle client#0.1.0~serve: unsafe-perm in lifecycle true
8 verbose lifecycle client#0.1.0~serve: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/alexsexotic/Desktop/work/Test - mongod:node/client/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/alexsexotic/.npm-global/bin
9 verbose lifecycle client#0.1.0~serve: CWD: /Users/alexsexotic/Desktop/work/Test - mongod:node/client
10 silly lifecycle client#0.1.0~serve: Args: [ '-c', 'vue-cli-service serve' ]
11 info lifecycle client#0.1.0~serve: Failed to exec serve script
12 verbose stack Error: client#0.1.0 serve: `vue-cli-service serve`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:182:13)
12 verbose stack at maybeClose (internal/child_process.js:962:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
13 verbose pkgid client#0.1.0
14 verbose cwd /Users/alexsexotic/Desktop/work/Test - mongod:node/client
15 verbose Darwin 17.2.0
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
17 verbose node v10.14.0
18 verbose npm v6.4.1
19 error file sh
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error client#0.1.0 serve: `vue-cli-service serve`
23 error spawn ENOENT
24 error Failed at the client#0.1.0 serve script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
You may check your current cli installation and maybe reinstall your vue-cli. Basically, an npx command runs within your project directory. So running npx [whatever] will always use modules installed within your project itself while npm run [whatever] may refer to some globally installed dependencies.
That said, you might also try using yarn. In the past I've also had some trouble running vue-cli through npm so I switched to yarn.
However I can not help you regarding your index.html problem since this may be another issue. But if you've bootstrapped a fresh vue project throughout vue-cli, it should work.
You can try this:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
It's work for me.

I receive the following error when installing angular cli

I am having problems with angular cli again (on a mac). Here is my log. I tried uninstalling the installing however get exactly same error. Any suggestions? Most probably PATH issue??
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'build', 'dev' ]
2 info using npm#3.10.10
3 info using node#v6.10.3
4 info build /Users/user/Documents/Sites/website/dev
5 verbose stack Error: ENOENT: no such file or directory, open '/Users/user/Documents/Sites/website/dev/package.json'
5 verbose stack at Error (native)
6 verbose cwd /Users/user/Documents/Sites/website
7 error Darwin 16.5.0
8 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "build" "dev"
9 error node v6.10.3
10 error npm v3.10.10
11 error path /Users/user/Documents/Sites/website/dev/package.json
12 error code ENOENT
13 error errno -2
14 error syscall open
15 error enoent ENOENT: no such file or directory, open '/Users/user/Documents/Sites/website/dev/package.json'
16 error enoent ENOENT: no such file or directory, open '/Users/user/Documents/Sites/website/dev/package.json'
16 error enoent This is most likely not a problem with npm itself
16 error enoent and is related to npm not being able to find a file.
17 verbose exit [ -2, true ]
You must check if you did npm --init because this might happen that you forgot to initialise npm and there is no package.json file present there which could not be found according to the line 5 of the error.
If that does not work then try this npm install npm#latest -g
If that also does not work then try these :
1. Ensure dependencies described correctly on package.json
2. Then type npm install and Enter.
3. Check issue still exists. and If issue not resolved, continue these
methods.
4. type npm cache clean and hit Enter
5. type sudo npm install -g npm and hit Enter.
6. Retry npm install and hit Enter.