简体   繁体   English

Npm启动错误未捕获的错误:找不到模块'serialport

[英]Npm start errors Uncaught Error: Cannot find module 'serialport

I got an error when I'm trying to run my angular app. 尝试运行我的角度应用程序时出现错误。 I have installed nodejs,python,electron but can't run the app... I write "npm start" command in CMD but I got an error like this: 我已经安装了nodejs,python,electron但无法运行该应用程序...我在CMD中编写了“ npm start”命令,但出现了这样的错误:

C:\xampp\htdocs\string-desktop>npm start
npm WARN invalid config registry=""
npm WARN invalid config Must be a full url with 'http://'
npm WARN invalid config registry=""
npm WARN invalid config Must be a full url with 'http://'

> ExhangeDesktop@0.1.0 start C:\xampp\htdocs\string-desktop
> electron . --enable-logging
    [11016:0313/090858.182:INFO:CONSOLE(8)] "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.", source: file:///C:/xampp/htdocs/string-desktop/src/thirdparty/less-1.3.3.min.js (8)
    [11016:0313/090858.288:INFO:CONSOLE(8)] "less: parsed file:///C:/xampp/htdocs/string-desktop/src/less/stringdesktop.less successfully.", source: file:///C:/xampp/htdocs/string-desktop/src/thirdparty/less-1.3.3.min.js (8)
    [11016:0313/090858.328:INFO:CONSOLE(8)] "less: css for file:///C:/xampp/htdocs/string-desktop/src/less/stringdesktop.less generated in 135ms", source: file:///C:/xampp/htdocs/string-desktop/src/thirdparty/less-1.3.3.min.js (8)
    [11016:0313/090858.329:INFO:CONSOLE(8)] "less: css generated in 135ms", source: file:///C:/xampp/htdocs/string-desktop/src/thirdparty/less-1.3.3.min.js (8)
    [11016:0313/090858.542:VERBOSE1:CONSOLE(7847)] "Main._createAppUI: 107.35302734375ms", source: chrome-devtools://devtools/bundled/shell.js (7847)
    [11016:0313/090858.666:VERBOSE1:CONSOLE(7847)] "Main._showAppUI: 121.22802734375ms", source: chrome-devtools://devtools/bundled/shell.js (7847)
    [11016:0313/090858.765:VERBOSE1:CONSOLE(7847)] "Main._initializeTarget: 51.9619140625ms", source: chrome-devtools://devtools/bundled/shell.js (7847)
    [11016:0313/090858.796:INFO:CONSOLE(604)] "Uncaught Error: Cannot find module 'serialport'", source: internal/modules/cjs/loader.js (604)
    [11016:0313/090858.812:INFO:CONSOLE(604)] "Uncaught Error: Cannot find module 'iconv-lite'", source: internal/modules/cjs/loader.js (604)
    [11016:0313/090858.817:INFO:CONSOLE(18)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/utils/Sync.js (18)
    [11016:0313/090858.822:INFO:CONSOLE(4)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/utils/EcrCommands.js (4)
    [11016:0313/090858.827:INFO:CONSOLE(3)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/utils/Ecr.js (3)
    [11016:0313/090858.828:INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/utils/Updater.js (1)
    [11016:0313/090858.955:WARNING:CONSOLE(184)] "%cElectron Security Warning (Insecure Content-Security-Policy)", source: C:\xampp\htdocs\string-desktop\node_modules\electron\dist\resources\electron.asar\renderer\security-warnings.js (184)
    [11016:0313/090858.977:VERBOSE1:CONSOLE(7847)] "Main._lateInitialization: 2.093994140625ms", source: chrome-devtools://devtools/bundled/shell.js (7847)
    [11016:0313/090859.346:INFO:CONSOLE(3)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Widget.js (3)
    [11016:0313/090859.354:INFO:CONSOLE(4)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/TableSelector.js (4)
    [11016:0313/090859.363:INFO:CONSOLE(31)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Operation.js (31)
    [11016:0313/090859.366:INFO:CONSOLE(3)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Model.js (3)
    [11016:0313/090859.372:INFO:CONSOLE(3)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/CurrencyStock.js (3)
    [11016:0313/090859.374:INFO:CONSOLE(3)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Transition.js (3)
    [11016:0313/090859.377:INFO:CONSOLE(9)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/DayFinish.js (9)
    [11016:0313/090859.379:INFO:CONSOLE(3)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Controller.js (3)
    [11016:0313/090859.383:INFO:CONSOLE(4)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Config.js (4)
    [11016:0313/090859.393:INFO:CONSOLE(66)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Home.js (66)
    [11016:0313/090859.395:INFO:CONSOLE(3)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Login.js (3)
    [11016:0313/090859.398:INFO:CONSOLE(4)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/DateChanger.js (4)
    [11016:0313/090859.405:INFO:CONSOLE(84)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/Chatter.js (84)
    [11016:0313/090859.408:INFO:CONSOLE(4)] "Uncaught TypeError: Cannot read property 'extend' of undefined", source: file:///C:/xampp/htdocs/string-desktop/src/controllers/EcrDebug.js (4)
    [11016:0313/090859.410:INFO:CONSOLE(59)] "Uncaught TypeError: up.App is not a constructor", source: file:///C:/xampp/htdocs/string-desktop/src/init.js (59)
    [11016:0313/090859.423:INFO:CONSOLE(184)] "%cElectron Security Warning (Insecure Content-Security-Policy)", source: C:\xampp\htdocs\string-desktop\node_modules\electron\dist\resources\electron.asar\renderer\security-warnings.js (184)

Could someone help me ? 有人可以帮我吗?

I believe you are using the wrong command run the angular application you need to use the following command to run the angular application. 我相信您使用错误的命令运行角度应用程序时需要使用以下命令来运行角度应用程序。

Navigate to your project directory and run the following command. 导航到您的项目目录并运行以下命令。

ng serve ng服务

Hope this will help! 希望这会有所帮助!

I fixed it! 我修好了它! I deleted node_modules folder and reinstalled npm and now it's all okay. 我删除了node_modules文件夹并重新安装了npm,现在一切正常。 Thanks to all! 谢谢大家!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM