欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

【ERROR】Error: Cannot find module '../models/config'

程序员文章站 2022-03-03 19:43:43
...

错误描述

[email protected]:~/cprogrames/SupplyChainFabric-master/angular-app$ npm start

> [email protected] start /home/cielo/cprogrames/SupplyChainFabric-master/angular-app
> ng serve --proxy-config proxy.conf.js --host localhost

module.js:550
    throw err;
    ^

Error: Cannot find module '../models/config'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/cielo/cprogrames/SupplyChainFabric-master/angular-app/node_modules/.bin/ng:7:19)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `ng serve --proxy-config proxy.conf.js --host localhost`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cielo/.npm/_logs/2019-04-25T12_49_27_894Z-debug.log
[email protected]:~/cprogrames/SupplyChainFabric-master/angular-app$

解决方法

应该是node module的问题吧,我重新将该文件夹(node_modules文件夹)删掉安装了一下,ok了。

[email protected]:~/cprogrames/SupplyChainFabric-master/angular-app$ npm install

> [email protected] install /home/cielo/cprogrames/SupplyChainFabric-master/angular-app/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/cielo/.npm/node-sass/4.11.0/linux-x64-57_binding.node

> [email protected] postinstall /home/cielo/cprogrames/SupplyChainFabric-master/angular-app/node_modules/node-sass
> node scripts/build.js

Binary found at /home/cielo/cprogrames/SupplyChainFabric-master/angular-app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1185 packages from 1406 contributors and audited 9790 packages in 831.48s
found 44 vulnerabilities (15 low, 14 moderate, 15 high)
  run `npm audit fix` to fix them, or `npm audit` for details
[email protected]:~/cprogrames/SupplyChainFabric-master/angular-app$ npm start

> [email protected] start /home/cielo/cprogrames/SupplyChainFabric-master/angular-app
> ng serve --proxy-config proxy.conf.js --host localhost

** NG Live Development Server is running on http://localhost:4200 **
 10% building modules 4/4 modules 0 active[HPM] Proxy created: [ '/auth', '/api' ]  ->  http://localhost:3000
[HPM] Proxy created: /  ->  http://localhost:3000
Hash: 3eddcba3824071a6e78c                                                               
Time: 32351ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 297 kB {5} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 192 kB {4} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 184 kB {5} [initial] [rendered]
chunk    {3} scripts.bundle.js, scripts.bundle.js.map (scripts) 441 kB {5} [initial] [rendered]
chunk    {4} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.15 MB [initial] [rendered]
chunk    {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.