【问题标题】:npm start command not workingnpm start 命令不起作用
【发布时间】:2023-03-06 11:35:01
【问题描述】:

我正在使用旧 Typescript 1.8 版的 Vs2013 我也刚刚安装了带有新打字稿版本 2.3 的 VS 2015

当我从我的项目路径尝试 npm start 命令时,它不起作用,给出以下错误。

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR!     C:\Project\Angular2Demo\Angular2Demo\npm-debug.log

有什么想法吗? 提前致谢

【问题讨论】:

  • npm ERR! network In most cases you are behind a proxy or have bad network settings. 你在代理后面吗?你能在互联网上 ping 一些东西(谷歌)吗?
  • 是的,我可以 ping 谷歌
  • 我也试过 npm uninstall -g angular-cli npm -g cache clean npm install -g -f angular-cli..但是在执行最后一个命令 npm install -g -f angular-cli 时。我出错了
  • npm config get proxy npm config get https-proxy - 谁能指导我这两个返回空值的命令?

标签: angularjs typescript npm npm-install


【解决方案1】:

我会说这要么是文件夹中的权限问题(尝试 chmod 777 * 从文件夹内部),要么是系统中的局部变量问题,它指向您以前的 TS 版本。试试看,然后让我们回来提供信息。

【讨论】:

  • 您好我可以看到三个 tyecript 文件夹,因为我的电脑上安装了 VS 上的差异版本。当我检查环境变量“PATH”时,我看不到任何与 NPM 或类型脚本相关的内容?
  • 如果您要使用 npm start 命令,我建议您从 npm 全局安装 Typescript,然后将变量路径更改为该版本。您的问题将消失
  • 我也试过 npm uninstall -g angular-cli npm -g cache clean npm install -g -f angular-cli..但是在执行最后一个命令 npm install -g -f angular-cli 时。我出错了
  • 还有什么我需要做的指导我的步骤吗?
  • 现在我很困惑你到底是什么问题,因为你抱怨的是 TS 而不是 Angular 或 Angular CLI
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-01-04
  • 1970-01-01
  • 2017-06-10
  • 2017-07-24
  • 2014-11-17
  • 1970-01-01
相关资源
最近更新 更多