【发布时间】:2017-02-17 21:22:07
【问题描述】:
在 Windows 环境中,我有: 节点 v4.6.0 npm v3.10.8
我的本地打字稿版本是:
npm run tsc -v
3.10.8
但是,有时我想使用我的全局 tsc(因为某种原因,gulp 使用全局 tsc)但是当我这样做时:
npm install tsc -g
tsc -v
我的 typescript 编译器得到了 1.5.3 版本
当我尝试将其强制安装到我需要的确切版本时:
npm install tsc@3.10.8 -g
我得到:
`
npm 错误! Windows_NT 10.0.14393
npm 错误! argv "C:\Program Files\nodejs\node.exe" "C:\Users\DT\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "tsc@3.10.8" “-G”
npm 错误!节点 v4.6.0
npm 错误! npm v3.10.8
npm 错误!代码ETARGET
npm 错误! notarget 未找到兼容版本:tsc@3.10.8 npm 错误! notarget 有效的安装目标: npm 错误!无目标 1.20150623.0、1.20150622.0、1.20150619.0、1.0.0 `
顺便说一句,我默认安装了节点,我的 npm 版本是 2,但我可以将它更新到 3.10.8,这样就可以了。但是对于打字稿,没办法。
有什么想法吗?
PS:我的平台是windows 10
【问题讨论】:
标签: node.js windows npm npm-install tsc