简体   繁体   English

我收到一个node.js module.js:473错误消息

[英]I am getting a node.js module.js:473 error message

I have recently install the latest version of node.js (v8.6.0 Current). 我最近安装了最新版本的node.js(v8.6.0当前)。 I am currently learning node.js but I'm having trouble using the command line to get into my programming files as per the lessons. 我目前正在学习node.js,但根据课程,无法使用命令行进入我的编程文件。 I keep getting the below error message. 我不断收到以下错误消息。 Can anyone tell me what I've done wrong. 谁能告诉我我做错了什么。 I've restarted my computer and reinstalled node.js several times already. 我已经重新启动计算机并重新安装了node.js多次。

Thank you, Edwin 谢谢埃德温

module.js:473
throw err;

Error: Cannot find module 'C:\User\edwin\desktop'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:453:25)
    at Function.Module.runMain (modlue.js:665:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:607:3

somewhere in the code you have written you either have a line like : ... require("C:\\User\\edwin\\desktop") or require(".") or require('desktop') or similar. 在您编写的代码中的某处,您可能会像这样一行: ... require("C:\\User\\edwin\\desktop")require(".")require('desktop')或类似名称。

This is looking for an index.js file in the folder which is not there, or a module named desktop that you have not installed. 这是在不存在的文件夹中或者尚未安装的名为desktop的模块中寻找index.js文件。 If you show us your source file, we can actually tell you what is wrong. 如果您向我们展示您的源文件,我们实际上可以告诉您出了什么问题。

您应该在终端中使用npm run dev代替node run dev。

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

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