无效或意外的令牌npm

时间:2018-10-02 15:52:06

标签: node.js windows npm npm-install

我从here下载了Angular QuickStart,按照说明进行了操作,并在VSCode中将其打开。现在尝试运行它,但是在“ npm install”失败。我的猜测是npm有问题。下面是错误

PS C:\Angular\quickstart-master\quickstart-master> npm install
C:\Users\<user>\AppData\Roaming\npm\node_modules\npm\node_modules\validate-npm-package-name\index.js:104
  return �h�&╔�.�
         ^

SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\j1m4211\AppData\Roaming\npm\node_modules\npm\lib\utils\error-message.js:4:21)
PS C:\Angular\quickstart-master\quickstart-master> npm start
C:\Users\<user>\AppData\Roaming\npm\node_modules\npm\node_modules\validate-npm-package-name\index.js:104
  return �h�&╔�.�

即使尝试执行“ npm cache clean”,我也会遇到相同的错误

enter image description here 我已经尝试过针对与之相关的其他问题提及的解决方案,但对我没有任何帮助。

0 个答案:

没有答案