npm install在我的角度项目根目录中构建.cmd文件 [英] npm install is building .cmd files in my angular project root directory

查看:113
本文介绍了npm install在我的角度项目根目录中构建.cmd文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已经使用了很长时间的项目,并且它已经构建和编译了几个月(并且仍然在另一台机器上进行).现在,当我运行命令npm install时,它可以正常运行,但是在过程结束时,它将在项目的根文件夹中生成大量的.cmd文件(以及另一个随附文件).

I have a project that I've been working with for quite some time and it has built and compiled (and still does on a different machine) for months. Now, when I run the command npm install it runs as normal, but at the end of the process, it builds out tons of .cmd files (and another accompanying file) in the root folder of my project.

当我运行ng服务时,出现错误:未知的浏览器查询 basedir = $(dirname"$(echo" $ 0"| sed -e's,\\,/,g,)")

when I run ng serve i get the error: Unknown browser query basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

对于如何使我的项目回到可用和可构建的状态,我完全感到困惑.从来没有像我这样的角度构建问题.我的package.json文件也在下面.

I'm completely stumped as to how to get my project back to a usable and buildable state. Have never had problems with my angular builds like this. Also my package.json file is below.

{
  "name": "project",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
 "private": true,
"dependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/animations": "^4.0.1",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"angular2-notifications": "^0.7.4",
"core-js": "^2.4.1",
"pdfmake": "^0.1.28",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
 },
"devDependencies": {
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}

推荐答案

更改笔记本电脑域并创建新的用户配置文件后,我面临同样的问题.

I face the same issue after changing my laptop domain and create a new user profile.

这些文件应在 node_modules/.bin 文件夹下生成.

These files should be generated under node_modules/.bin folder.

作为一种解决方法,您可以在每次运行 npm install 然后运行 ng serve 后手动删除这些文件,这样就不会看到错误.

As a workaround, you can delete these files manually after each time you run npm install then run ng serve you should not see errors.

来自此处

您的 node_modules/.bin/文件夹的内容似乎是完全推送到您的根文件夹.这可能与安装在您计算机上的东西, npm 的配置或防病毒软件.

It looks like the contents of your node_modules/.bin/ folder are entirely pushed to your root folder. It might have to do with something installed on your computer, a config of npm or an antivirus.

这篇关于npm install在我的角度项目根目录中构建.cmd文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆