gpt4 book ai didi

json - npm 安装后类型无法正常工作

转载 作者:IT老高 更新时间:2023-10-28 23:22:39 28 4
gpt4 key购买 nike

我有以下 packages.json:

{
"name": "shopping-assistant-angular",
"version": "1.0.0",
"scripts": {
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.7",
"systemjs": "0.19.23",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.5.14"
},
"devDependencies": {
"bower": "^1.7.7",
"concurrently": "^1.0.0",
"grunt": "^0.4.5",
"grunt-chrome-manifest": "^0.3.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-copy": "^0.8.2",
"grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-htmlmin": "^0.6.0",
"grunt-contrib-uglify": "^0.11.1",
"grunt-filerev": "^2.3.1",
"grunt-ts": "^5.3.2",
"grunt-usemin": "^3.1.1",
"lite-server": "^2.0.1",
"load-grunt-tasks": "^3.4.0",
"typescript": "1.7.5",
"typings": "^0.6.8"
}
}

当我在我的目录中运行 npm install 时出现错误:'typings' 不被识别为内部或外部命令、可运行程序或批处理文件。

在 Angular 2 快速入门指南中,他们使用以下 packages.json:

{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.7",
"systemjs": "0.19.22",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.5.15"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^1.7.5",
"typings":"^0.6.8"
}
}

在所有软件包安装完成后成功运行“打字安装”。

不知道为什么运行这些非常相似的 packages.json 文件会导致完全不同的结果。

最佳答案

Gabe O'Leary是对的(见comment),首先尝试全局安装typingsnpm install typings -g 如果你使用的是 Mac,你可能需要使用 sudo 命令 sudo npm install typings -g

关于json - npm 安装后类型无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35662790/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com