gpt4 book ai didi

javascript - WebStorm 无法创建 Node.js Express 应用程序

转载 作者:搜寻专家 更新时间:2023-11-01 00:14:12 25 4
gpt4 key购买 nike

我在尝试创建 Node.js Express 应用程序时遇到以下错误:

Error creating Node.js Express App. Cannot find C:\Users\Trunapushpa\AppData\Local\Temp\intellij-express-generator5627\node_modules\express-generator\bin\express

This is the pic showing the error

我也尝试在 Windows 和 Linux 中创建一个新的 Node.js Express 应用程序,但每次在这两个操作系统中我都会遇到完全相同的错误。这是在 Windows 中运行的 WebStorm 的日志文件:

2017-04-01 02:45:45,619 [      0]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------ 
2017-04-01 02:45:45,664 [ 45] INFO - #com.intellij.idea.Main - IDE: WebStorm (build #WS-163.12024.17, 31 Jan 2017 19:45)
2017-04-01 02:45:45,664 [ 45] INFO - #com.intellij.idea.Main - OS: Windows 10 (10.0, x86)
2017-04-01 02:45:45,664 [ 45] INFO - #com.intellij.idea.Main - JRE: 1.8.0_112-release-408-b6 (JetBrains s.r.o)
2017-04-01 02:45:45,664 [ 45] INFO - #com.intellij.idea.Main - JVM: 25.112-b6 (OpenJDK Server VM)
2017-04-01 02:45:45,666 [ 47] INFO - #com.intellij.idea.Main - JVM Args: -Xms128m -Xmx512m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djb.vmOptionsFile=C:\Program Files (x86)\JetBrains\WebStorm 2016.3.3\bin\webstorm.exe.vmoptions -Xbootclasspath/a:C:\Program Files (x86)\JetBrains\WebStorm 2016.3.3\lib\boot.jar -Didea.platform.prefix=WebStorm -Didea.paths.selector=WebStorm2016.3 -XX:ErrorFile=C:\Users\Trunapushpa\java_error_in_webstorm_%p.log -XX:HeapDumpPath=C:\Users\Trunapushpa\java_error_in_webstorm.hprof
2017-04-01 02:45:45,667 [ 48] INFO - #com.intellij.idea.Main - ext: C:\Program Files (x86)\JetBrains\WebStorm 2016.3.3\jre\jre\lib\ext: [access-bridge-32.jar, access-bridge.jar, cldrdata.jar, dnsns.jar, jaccess.jar, jfxrt.jar, localedata.jar, meta-index, nashorn.jar, sunec.jar, sunjce_provider.jar, sunmscapi.jar, sunpkcs11.jar, zipfs.jar]
2017-04-01 02:45:45,667 [ 48] INFO - #com.intellij.idea.Main - JNU charset: Cp1252
2017-04-01 02:45:45,732 [ 113] INFO - #com.intellij.idea.Main - JNA library (32-bit) loaded in 65 ms
2017-04-01 02:45:45,735 [ 116] INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational
2017-04-01 02:45:45,736 [ 117] INFO - #com.intellij.idea.Main - Using "FocusKiller" library to prevent focus stealing.
2017-04-01 02:45:45,746 [ 127] INFO - #com.intellij.util.ui.JBUI - UI scale factor: 1.0
2017-04-01 02:45:51,478 [ 5859] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor js-nashorn-support.xml
2017-04-01 02:45:51,618 [ 5999] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor uml-properties-support.xml
2017-04-01 02:45:51,619 [ 6000] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor uml-java-support.xml
2017-04-01 02:45:52,075 [ 6456] INFO - llij.ide.plugins.PluginManager - 55 plugins initialized in 886 ms
2017-04-01 02:45:52,092 [ 6473] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: ASP (0.1), AngularJS (163.12024.17), CSS Support (163.12024.17), CVS Integration (11), CoffeeScript (2.0), Cucumber.js (0.1), Dart (163.12024.17), Docker integration (2.4.1), EJS (163.12024.17), EditorConfig (163.12024.17), File Watchers (163.12024.17), Gherkin (999.999), Git Integration (8.1), GitHub (163.12024.17), HAML (163.12024.17), HTML Tools (2.0), Handlebars/Mustache (163.12024.17), IDEA CORE (163.12024.17), IntelliLang (8.0), Java Server Pages (JSP) Integration (1.0), JavaScript Debugger (1.0), JavaScript Intention Power Pack (0.9.4), JavaScript Support (1.0), Karma (163.12024.17), LESS support (163.12024.17), LiveEdit (163.12024.17), Meteor (163.12024.17), Node.js Remote Interpreter (163.12024.17), NodeJS (163.12024.17), Perforce Integration (2.0), PhoneGap/Cordova Plugin (163.12024.17), Polymer & Web Components (999.999), Pug (ex-Jade) (163.12024.17), QuirksMode (163.12024.17), REST Client (163.12024.17), Refactor-X (2.01), Remote Hosts Access (0.1), SASS support (163.12024.17), SSH Remote Run (0.1), Settings Repository (163.12024.17), Spy-js (163.12024.17), Stylus support (999.999), Subversion Integration (1.1), Task Management (1.0), Terminal (0.1), TextMate bundles support (163.12024.17), Time Tracking (1.0), UML Support (1.0), Vagrant (0.6.VERSION), W3C Validators (2.0), XPathView + XSLT Support (4), XSLT-Debugger (1.4), YAML (163.12024.17), Yeoman (163.12024.17), hg4idea (10.0)
2017-04-01 02:45:52,770 [ 7151] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=200; buffer=10; max=474
2017-04-01 02:45:52,800 [ 7181] INFO - pl.local.NativeFileWatcherImpl - Starting file watcher: C:\Program Files (x86)\JetBrains\WebStorm 2016.3.3\bin\fsnotifier.exe
2017-04-01 02:45:52,815 [ 7196] INFO - pl.local.NativeFileWatcherImpl - Native file watcher is operational.
2017-04-01 02:45:52,927 [ 7308] INFO - pi.util.registry.RegistryState - Registry values changed by user:
2017-04-01 02:45:52,927 [ 7308] INFO - pi.util.registry.RegistryState - dumb.aware.run.configurations = true
2017-04-01 02:45:53,884 [ 8265] INFO - rains.ide.BuiltInServerManager - built-in server started, port 63342
2017-04-01 02:45:53,905 [ 8286] INFO - gs.impl.UpdateCheckerComponent - channel: release
2017-04-01 02:45:54,078 [ 8459] INFO - il.indexing.FileBasedIndexImpl - Index exts enumerated:65
2017-04-01 02:45:54,085 [ 8466] INFO - il.indexing.FileBasedIndexImpl - Index scheduled:7
2017-04-01 02:45:54,109 [ 8490] INFO - tellij.psi.stubs.StubIndexImpl - All stub exts enumerated:16
2017-04-01 02:45:54,109 [ 8490] INFO - tellij.psi.stubs.StubIndexImpl - stub exts update scheduled:0
2017-04-01 02:45:54,152 [ 8533] INFO - j.ide.script.IdeStartupScripts - 0 startup script(s) found
2017-04-01 02:45:54,273 [ 8654] INFO - plication.impl.ApplicationImpl - 80 application components initialized in 3088ms
2017-04-01 02:45:54,282 [ 8663] INFO - .intellij.idea.IdeaApplication - App initialization took 9647 ms
2017-04-01 02:45:55,494 [ 9875] INFO - pl$FileIndexDataInitialization - Initialization done:1407
2017-04-01 02:45:55,791 [ 10172] INFO - exImpl$StubIndexInitialization - Initialization done:297
2017-04-01 02:45:56,472 [ 10853] INFO - .openapi.application.Preloader - Finished preloading com.intellij.openapi.actionSystem.impl.ActionPreloader@191e350
2017-04-01 02:45:57,381 [ 11762] INFO - .openapi.application.Preloader - Finished preloading com.intellij.ide.ui.search.SearchableOptionPreloader@13fba
2017-04-01 02:45:57,443 [ 11824] INFO - ellij.project.impl.ProjectImpl - 104 project components initialized in 2111 ms
2017-04-01 02:45:57,519 [ 11900] INFO - le.impl.ModuleManagerComponent - 1 module(s) loaded in 65 ms
2017-04-01 02:45:57,610 [ 11991] INFO - .openapi.application.Preloader - Finished preloading com.intellij.codeInsight.completion.CompletionPreloader@10c5456
2017-04-01 02:45:58,072 [ 12453] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 109ms; general responsiveness: ok; EDT responsiveness: ok
2017-04-01 02:45:58,279 [ 12660] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 205ms; general responsiveness: ok; EDT responsiveness: ok
2017-04-01 02:45:58,448 [ 12829] INFO - tartup.impl.StartupManagerImpl - C:/Users/Trunapushpa/WebstormProjects/untitled1/.idea case-sensitivity: expected=false actual=false
2017-04-01 02:45:58,582 [ 12963] INFO - tor.impl.FileEditorManagerImpl - Project opening took 3660 ms
2017-04-01 02:52:54,045 [ 428426] INFO - ellij.project.impl.ProjectImpl - 15 project components initialized in 17 ms
2017-04-01 02:52:54,046 [ 428427] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2017-04-01 02:53:03,054 [ 437435] INFO - ellij.project.impl.ProjectImpl - 104 project components initialized in 33 ms
2017-04-01 02:53:03,055 [ 437436] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2017-04-01 02:53:03,077 [ 437458] INFO - i.vcs.changes.ChangeListWorker - default list not found when copy
2017-04-01 02:53:03,077 [ 437458] INFO - i.vcs.changes.ChangeListWorker - default list not found when copy in original object too
2017-04-01 02:53:03,328 [ 437709] INFO - i.vcs.changes.ChangeListWorker - default list not found when copy
2017-04-01 02:53:03,328 [ 437709] INFO - i.vcs.changes.ChangeListWorker - default list not found when copy in original object too
2017-04-01 02:53:03,420 [ 437801] INFO - Tools.base.JsbtStartupActivity - Detecting buildfiles for com.intellij.lang.javascript.buildTools.grunt.GruntfileManager
2017-04-01 02:53:03,420 [ 437801] INFO - Tools.base.JsbtStartupActivity - Detecting buildfiles for com.intellij.lang.javascript.buildTools.gulp.GulpfileManager
2017-04-01 02:53:03,421 [ 437802] INFO - Tools.base.JsbtStartupActivity - Detecting buildfiles for com.intellij.lang.javascript.buildTools.npm.PackageJsonFileManager
2017-04-01 02:53:03,423 [ 437804] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 7ms; general responsiveness: ok; EDT responsiveness: ok
2017-04-01 02:53:03,429 [ 437810] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 6ms; general responsiveness: ok; EDT responsiveness: ok
2017-04-01 02:53:03,449 [ 437830] INFO - xpress.ExpressProjectGenerator - Running '"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" install express-generator@4.15.0' in C:\Users\Trunapushpa\AppData\Local\Temp\intellij-express-generator2
2017-04-01 02:53:06,268 [ 440649] INFO - xpress.ExpressProjectGenerator - stdout: C:\Users\Trunapushpa\AppData\Local\Temp\intellij-express-generator2
`-- express-generator@4.15.0
+-- commander@2.9.0
| `-- graceful-readlink@1.0.1
+-- ejs@2.5.6
+-- mkdirp@0.5.1
| `-- minimist@0.0.8
`-- sorted-object@2.0.1
2017-04-01 02:53:06,268 [ 440649] INFO - xpress.ExpressProjectGenerator - stderr: npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Trunapushpa\AppData\Local\Temp\intellij-express-generator2\package.json'
npm WARN intellij-express-generator2 No description
npm WARN intellij-express-generator2 No repository field.
npm WARN intellij-express-generator2 No README data
npm WARN intellij-express-generator2 No license field.
2017-04-01 02:53:06,270 [ 440651] WARN - xpress.ExpressProjectGenerator - Cannot find C:\Users\Trunapushpa\AppData\Local\Temp\intellij-express-generator2\node_modules\express-generator\bin\express
com.jetbrains.nodejs.boilerplate.express.ExpressProjectGenerator$GeneratorException: Cannot find C:\Users\Trunapushpa\AppData\Local\Temp\intellij-express-generator2\node_modules\express-generator\bin\express
at com.jetbrains.nodejs.boilerplate.express.ExpressProjectGenerator.generateExpressApp(ExpressProjectGenerator.java:205)
at com.jetbrains.nodejs.boilerplate.express.ExpressProjectGenerator.generateProject(ExpressProjectGenerator.java:86)
at com.jetbrains.nodejs.boilerplate.express.ExpressProjectGenerator.generateProject(ExpressProjectGenerator.java:53)
at com.intellij.ide.util.projectWizard.AbstractNewProjectStep.a(AbstractNewProjectStep.java:218)
at com.intellij.platform.PlatformProjectOpenProcessor.doOpenProject(PlatformProjectOpenProcessor.java:234)
at com.intellij.ide.util.projectWizard.AbstractNewProjectStep.doGenerateProject(AbstractNewProjectStep.java:222)
at com.intellij.ide.util.projectWizard.AbstractNewProjectStep$AbstractCallback.consume(AbstractNewProjectStep.java:162)
at com.intellij.ide.util.projectWizard.AbstractNewProjectStep$AbstractCallback.consume(AbstractNewProjectStep.java:155)
at com.intellij.ide.util.projectWizard.ProjectSettingsStepBase$1.a(ProjectSettingsStepBase.java:131)
at com.intellij.openapi.project.DumbPermissionServiceImpl.allowStartingDumbModeInside(DumbPermissionServiceImpl.java:37)
at com.intellij.openapi.project.DumbService.allowStartingDumbModeInside(DumbService.java:294)
at com.intellij.ide.util.projectWizard.ProjectSettingsStepBase$1.actionPerformed(ProjectSettingsStepBase.java:130)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swin

最佳答案

该问题是由于最近 express-generator 结构的变化引起的:express.js 已重命名为 express-cli.js

修复

1.npm install -g express-generator

  1. 表达项目名称

  2. cd project_name, npm install

  3. 在 webstorm 中,文件 |打开,选择 project_name 文件夹

关于javascript - WebStorm 无法创建 Node.js Express 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43150327/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com