NPM安装和模块:338错误

时间:2015-07-16 05:49:59

标签: node.js npm

我在node.js上开始我的第一个项目并遇到了一些令人不安的错误。当我使用命令' node server.js'

Johns-Air:awesometest johnholman$ node server.js
module.js:338
    throw err;
          ^
Error: Cannot find module '/Users/johnholman/Desktop/awesometest/server.js'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

在寻找解决方案后,我尝试更新我的NPM,这就是我得到的:

Johns-Air:~ johnholman$ npm update -g
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "update" "-g"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /usr/local/bin/npm
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, unlink '/usr/local/bin/npm'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, unlink '/usr/local/bin/npm'] errno: -13, code: 'EACCES', path: '/usr/local/bin/npm' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/bin/npm'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  { [Error: EACCES, unlink '/usr/local/bin/npm'] errno: -13, code: 'EACCES', path: '/usr/local/bin/npm' }

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/johnholman/npm-debug.log

非常感谢任何帮助。

0 个答案:

没有答案