我已经安装了node.js和git hub。我也修改了环境变量。 当我转到存在package.jason文件的文件夹并输入以下命令
时 npm install
我正在解决这个错误。 这是详细的错误
pkottawa@PKOTTAWA-LAP /c/Program Files (x86)/nodejs/node_modules
$ cd npm/
pkottawa@PKOTTAWA-LAP /c/Program Files (x86)/nodejs/node_modules/npm
$ npm install
npm ERR! tar.unpack untar error C:\Users\pkottawa\AppData\Roaming\npm-
cache\nock\0.59.1\package.tgz
npm ERR! tar.unpack untar error C:\Users\pkottawa\AppData\Roaming\npm-cache\requ
ire-inject\1.1.1\package.tgz
npm ERR! tar.unpack untar error C:\Users\pkottawa\AppData\Roaming\npm-cache\mark
ed\0.3.3\package.tgz
npm ERR! tar.unpack untar error C:\Users\pkottawa\AppData\Roaming\npm-cache\npm-
registry-couchapp\2.6.7\package.tgz
npm ERR! tar.unpack untar error C:\Users\pkottawa\AppData\Roaming\npm-cache\npm-
registry-mock\1.0.0\package.tgz
npm ERR! tar.unpack untar error C:\Users\pkottawa\AppData\Roaming\npm-cache\mark
ed-man\0.1.4\package.tgz
npm ERR! tar.unpack untar error C:\Users\pkottawa\AppData\Roaming\npm-cache\tap\
0.5.0\package.tgz
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files (x86)\\nodejs\\node.exe" "c:\\Program Files (x8
6)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.1
npm ERR! npm v2.5.1
npm ERR! path c:\Program Files (x86)\nodejs\node_modules\npm\node_modules\nock
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! Error: EPERM, mkdir 'c:\Program Files (x86)\nodejs\node_modules\npm\nod
e_modules\nock'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM, mkdir 'c:\Program Files (x86)\nodejs\node_modules\npm
\node_modules\nock']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! path: 'c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modul
es\\nock',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: 'c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\no
de_modules\\nock',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ 'c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\
\fstream\\lib\\dir-writer.js:36:23',
npm ERR! 'c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\
\mkdirp\\index.js:46:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:99:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files (x86)\\nodejs\\node.exe" "c:\\Program Files (x8
6)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.1
npm ERR! npm v2.5.1
npm ERR! Uncaught, unspecified "error" event.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! c:\Program Files (x86)\nodejs\node_modules\npm\npm-debug.log
/c/Program Files (x86)/nodejs/npm: line 14: 7208 Signal 112 (core
dumped) "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
答案 0 :(得分:0)
我在错误的目录中执行此命令。 在npm安装之前,我们需要执行
export PATH=$PATH:directory-to-add
然后运行
npm install