当我在Angular应用程序的根目录中运行npm install时,它最终看起来像这样。就像它的安装节点或我的应用程序内部的东西一样,我不知道为什么
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 5/31/2019 3:41 PM e2e
d----- 5/31/2019 3:44 PM node_modules
d----- 5/31/2019 3:41 PM src
-a---- 3/29/2019 10:08 AM 246 .editorconfig
-a---- 5/31/2019 3:44 PM 321 acorn
-a---- 5/31/2019 3:44 PM 198 acorn.cmd
-a---- 3/29/2019 10:08 AM 4788 angular.json
-a---- 5/31/2019 3:44 PM 337 ansi-html
-a---- 5/31/2019 3:44 PM 214 ansi-html.cmd
-a---- 5/31/2019 3:44 PM 323 atob
-a---- 5/31/2019 3:44 PM 200 atob.cmd
-a---- 5/31/2019 3:44 PM 349 autoprefixer
-a---- 5/31/2019 3:44 PM 226 autoprefixer.cmd
-a---- 5/31/2019 3:44 PM 335 babylon
-a---- 5/31/2019 3:44 PM 212 babylon.cmd
-a---- 5/31/2019 3:44 PM 353 blocking-proxy
-a---- 5/31/2019 3:44 PM 230 blocking-proxy.cmd
-a---- 5/31/2019 3:44 PM 329 browserslist
-a---- 5/31/2019 3:44 PM 206 browserslist.cmd
-a---- 5/31/2019 3:44 PM 407 build-optimizer
-a---- 5/31/2019 3:44 PM 284 build-optimizer.cmd
-a---- 5/31/2019 3:44 PM 325 cssesc
-a---- 5/31/2019 3:44 PM 202 cssesc.cmd
-a---- 5/31/2019 3:44 PM 315 errno
-a---- 5/31/2019 3:44 PM 192 errno.cmd
-a---- 5/31/2019 3:44 PM 343 escodegen
-a---- 5/31/2019 3:44 PM 220 escodegen.cmd
-a---- 5/31/2019 3:44 PM 345 esgenerate
-a---- 5/31/2019 3:44 PM 222 esgenerate.cmd
-a---- 5/31/2019 3:44 PM 335 esparse
-a---- 5/31/2019 3:44 PM 212 esparse.cmd
-a---- 5/31/2019 3:44 PM 341 esvalidate
-a---- 5/31/2019 3:44 PM 218 esvalidate.cmd
-a---- 5/31/2019 3:44 PM 341 handlebars
-a---- 5/31/2019 3:44 PM 218 handlebars.cmd
-a---- 3/29/2019 10:08 AM 428 heijunka-visualization.iml
-a---- 5/31/2019 3:44 PM 347 image-size
-a---- 5/31/2019 3:44 PM 224 image-size.cmd
-a---- 5/31/2019 3:44 PM 347 import-local-fixture
-a---- 5/31/2019 3:44 PM 224 import-local-fixture.cmd
-a---- 5/31/2019 3:44 PM 339 in-install
-a---- 5/31/2019 3:44 PM 216 in-install.cmd
-a---- 5/31/2019 3:44 PM 339 in-publish
-a---- 5/31/2019 3:44 PM 216 in-publish.cmd
-a---- 5/31/2019 3:44 PM 329 istanbul
-a---- 5/31/2019 3:44 PM 206 istanbul.cmd
-a---- 5/31/2019 3:44 PM 377 ivy-ngcc
-a---- 5/31/2019 3:44 PM 254 ivy-ngcc.cmd
-a---- 5/31/2019 3:44 PM 335 jasmine
-a---- 5/31/2019 3:44 PM 212 jasmine.cmd
-a---- 5/31/2019 3:44 PM 335 js-yaml
-a---- 5/31/2019 3:44 PM 212 js-yaml.cmd
-a---- 5/31/2019 3:44 PM 321 jsesc
-a---- 5/31/2019 3:44 PM 198 jsesc.cmd
-a---- 5/31/2019 3:44 PM 323 json5
-a---- 5/31/2019 3:44 PM 200 json5.cmd
-a---- 5/31/2019 3:44 PM 325 JSONStream
-a---- 5/31/2019 3:44 PM 202 JSONStream.cmd
-a---- 5/31/2019 3:44 PM 321 karma
-a---- 5/31/2019 3:44 PM 198 karma.cmd
-a---- 5/31/2019 3:44 PM 319 lessc
-a---- 5/31/2019 3:44 PM 196 lessc.cmd
-a---- 5/31/2019 3:44 PM 329 loose-envify
-a---- 5/31/2019 3:44 PM 206 loose-envify.cmd
-a---- 5/31/2019 3:44 PM 349 miller-rabin
-a---- 5/31/2019 3:44 PM 226 miller-rabin.cmd
-a---- 5/31/2019 3:44 PM 313 mime
-a---- 5/31/2019 3:44 PM 190 mime.cmd
-a---- 5/31/2019 3:44 PM 325 mkdirp
-a---- 5/31/2019 3:44 PM 202 mkdirp.cmd
-a---- 5/31/2019 3:44 PM 331 multicast-dns
-a---- 5/31/2019 3:44 PM 208 multicast-dns.cmd
-a---- 5/31/2019 3:44 PM 329 ng
-a---- 5/31/2019 3:44 PM 373 ng-xi18n
-a---- 5/31/2019 3:44 PM 250 ng-xi18n.cmd
-a---- 5/31/2019 3:44 PM 206 ng.cmd
-a---- 5/31/2019 3:44 PM 357 ngc
-a---- 5/31/2019 3:44 PM 234 ngc.cmd
-a---- 5/31/2019 3:44 PM 339 node-gyp
-a---- 5/31/2019 3:44 PM 216 node-gyp.cmd
-a---- 5/31/2019 3:44 PM 337 node-sass
-a---- 5/31/2019 3:44 PM 214 node-sass.cmd
-a---- 5/31/2019 3:44 PM 323 nopt
-a---- 5/31/2019 3:44 PM 200 nopt.cmd
-a---- 5/31/2019 3:44 PM 347 not-in-install
-a---- 5/31/2019 3:44 PM 224 not-in-install.cmd
-a---- 5/31/2019 3:44 PM 347 not-in-publish
-a---- 5/31/2019 3:44 PM 224 not-in-publish.cmd
-a---- 3/29/2019 10:08 AM 383104 package-lock.json
-a---- 3/29/2019 10:08 AM 1572 package.json
-a---- 5/31/2019 3:44 PM 357 parser
-a---- 5/31/2019 3:44 PM 234 parser.cmd
-a---- 5/31/2019 3:44 PM 341 protractor
-a---- 5/31/2019 3:44 PM 218 protractor.cmd
-a---- 3/29/2019 10:08 AM 1038 README.md
-a---- 5/31/2019 3:44 PM 335 regjsparser
-a---- 5/31/2019 3:44 PM 212 regjsparser.cmd
-a---- 5/31/2019 3:44 PM 317 rimraf
-a---- 5/31/2019 3:44 PM 194 rimraf.cmd
-a---- 5/31/2019 3:44 PM 339 sassgraph
-a---- 5/31/2019 3:44 PM 216 sassgraph.cmd
-a---- 5/31/2019 3:44 PM 325 semver
-a---- 5/31/2019 3:44 PM 202 semver.cmd
-a---- 5/31/2019 3:44 PM 317 sha.js
-a---- 5/31/2019 3:44 PM 194 sha.js.cmd
-a---- 5/31/2019 3:44 PM 323 shjs
-a---- 5/31/2019 3:44 PM 200 shjs.cmd
-a---- 5/31/2019 3:44 PM 331 sshpk-conv
-a---- 5/31/2019 3:44 PM 208 sshpk-conv.cmd
-a---- 5/31/2019 3:44 PM 331 sshpk-sign
-a---- 5/31/2019 3:44 PM 208 sshpk-sign.cmd
-a---- 5/31/2019 3:44 PM 335 sshpk-verify
-a---- 5/31/2019 3:44 PM 212 sshpk-verify.cmd
-a---- 5/31/2019 3:44 PM 329 strip-indent
-a---- 5/31/2019 3:44 PM 206 strip-indent.cmd
-a---- 5/31/2019 3:44 PM 325 stylus
-a---- 5/31/2019 3:44 PM 202 stylus.cmd
-a---- 5/31/2019 3:44 PM 329 terser
-a---- 5/31/2019 3:44 PM 206 terser.cmd
-a---- 5/31/2019 3:44 PM 323 tree-kill
-a---- 5/31/2019 3:44 PM 200 tree-kill.cmd
-a---- 5/31/2019 3:44 PM 329 ts-node
-a---- 5/31/2019 3:44 PM 206 ts-node.cmd
-a---- 5/31/2019 3:44 PM 327 tsc
-a---- 5/31/2019 3:44 PM 204 tsc.cmd
-a---- 3/29/2019 10:08 AM 435 tsconfig.json
-a---- 5/31/2019 3:44 PM 325 tslint
-a---- 5/31/2019 3:44 PM 202 tslint.cmd
-a---- 3/29/2019 10:08 AM 2824 tslint.json
-a---- 5/31/2019 3:44 PM 337 tsserver
-a---- 5/31/2019 3:44 PM 214 tsserver.cmd
-a---- 5/31/2019 3:44 PM 335 uglifyjs
-a---- 5/31/2019 3:44 PM 212 uglifyjs.cmd
-a---- 5/31/2019 3:44 PM 317 uuid
-a---- 5/31/2019 3:44 PM 194 uuid.cmd
-a---- 5/31/2019 3:44 PM 355 webdriver-manager
-a---- 5/31/2019 3:44 PM 232 webdriver-manager.cmd
-a---- 5/31/2019 3:44 PM 335 webpack
-a---- 5/31/2019 3:44 PM 379 webpack-dev-server
-a---- 5/31/2019 3:44 PM 256 webpack-dev-server.cmd
-a---- 5/31/2019 3:44 PM 212 webpack.cmd
-a---- 5/31/2019 3:44 PM 321 which
-a---- 5/31/2019 3:44 PM 198 which.cmd
编辑
package.json
{
"name": "my-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.2.0",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0",
"@ng-bootstrap/ng-bootstrap": "^4.1.0",
"ag-grid-angular": "^20.0.0",
"ag-grid-community": "^20.1.0-beta.0",
"bootstrap": "^4.2.1",
"core-js": "^2.5.4",
"date-fns": "^1.30.1",
"ngx-loading": "^3.0.1",
"rxjs": "~6.3.3",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.12.0",
"@angular/cli": "~7.2.3",
"@angular/compiler-cli": "^7.2.7",
"@angular/language-service": "~7.2.0",
"@fortawesome/fontawesome-free": "^5.7.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}
解决方案 对我来说,解决方案是按照此处所述完全卸载节点 ERROR in ./ansi-html 1:0 Module parse failed: Unexpected character '#' (1:0)