在Windows上安装软件包时出现NPM错误

时间:2017-09-01 06:47:52

标签: node.js windows npm npm-install

我一直在尝试为两个项目安装依赖项,而安装xml2jsonursa软件包时遇到了类似的错误:

xml2json

C:\Users\home\Projects\project1\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "pangyp" rebuild )
module.js:491
    throw err;
    ^

Error: Cannot find module 'C:\Users\home\Projects\project1\node_modules\node-expat\pangyp'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Function.Module.runMain (module.js:609:10)
    at startup (bootstrap_node.js:158:16)

ursa

C:\Users\home\Projects\project2\node_modules\ursa>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "pangyp" rebuild )
module.js:491
    throw err;
    ^

Error: Cannot find module 'C:\Users\home\Projects\project2\node_modules\ursa\pangyp'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Function.Module.runMain (module.js:609:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3

版本:

node v8.4.0
npm 5.3.0
Windows 7 Ultimate 64

我运行npm rebuild node-expat发髻无效。

0 个答案:

没有答案