Node.js V6.11.5 error in Windows 10

Asked

Viewed 327 times

3

I installed Node.js to study Angular 2, I downloaded it from the Node website, but after installing, when I type npm start in cmd of my PC, I get the error below, I am giving command in file folder package.json C:\Program Files\nodejs\node_modules\npm Does anyone have any idea how to fix it? Please! :)

C:\Users\Sarah Santana>node -v
v6.11.5

C:\Users\Sarah Santana>cd\Program Files\nodejs\node_modules\npm

C:\Program Files\nodejs\node_modules\npm>npm start
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10

npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! path C:\Program Files\nodejs\node_modules\npm\npm-debug.log.3610650318
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open

npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_modules\npm\npm-debug.log.3610650318'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_modules\npm\npm-debug.log.3610650318'
npm ERR!     at Error (native)
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'open',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\npm\\npm-debug.log.3610650318' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Program Files\nodejs\node_modules\npm\npm-debug.log
  • you must run inside via command line inside the folder/directory of your example application: cd C:\Users\Sarah Santana\Desktop\your_project_path in this run folder npm start if your project has a file package json. with the entry "scripts.start"

  • 1

    @Lauromoraes, put as a response, I will remove mine because you commented before.

1 answer

2


Apparently you’re executing the command npm start at wrong location... you are running inside the installation folder on NodeJs.

You should create a folder for your project and add the file to it .js execution of your application. To use the command npm start there should be in your folder a file package json. with the instructions to load "scripts" example:

index js.

// um simples console
console.log('Hello World!')

package json.

{
   "name": "nome-de-sua-aplicação",
   "main": "index.js",
   "version": "1.0.0",
   "scripts": {
       "start": "index"
   }
}

Note that the file package json. may contain a lot of information being in this example when using npm start will execute the file within the instruction scripts.start through this command it is also possible to add optional arguments.

References

NPM Documentation package json.

NPM Documentation start command


editing

Note: the above example suggests to use inside directories common to the user (desktop, documents, etc...) however its log error reports lack of administrative privileges as it was running inside folders commonly protected by the operating system.

You can execute commands NodeJs even inside bad system protected folders if this is the case should start the prompt command (CMD) with administrator privileges.

  • Thank you! I did what I said and it worked!!!! vlwwww

Browser other questions tagged

You are not signed in. Login or sign up in order to post.