【发布时间】:2017-10-10 03:04:33
【问题描述】:
我在全局和本地安装了 typescript 和 gulp-typescript,甚至我在 package.json 中的 devDependencies 也有"gulp-typescript": "^3.1.6" 但是当我在 cmd 中写 gulp tsc 时,它说:typescript is not installed - install with 'npm install typescript --save-dev'
【问题讨论】:
-
你能出示你的
package.json吗? -
@AlekseyL
{ "name": "typescript", "version": "1.0.0", "description": "", "main": "gulpfiles.js", "dependencies": { "gulp": "^3.9.1", "gulp-util": "^3.0.8" }, "devDependencies": { "gulp": "^3.9.1", "gulp-typescript": "^3.1.6", "gulp-util": "^3.0.8" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Arman Shojaei", "license": "ISC" } -
只需将
"name": "typescript"更改为其他内容,例如"name": "typescript-test"并运行npm install。您不能将包命名为其依赖项之一。 -
@AlekseyL 非常感谢
标签: typescript gulp gulp-typescript