Cannot create project via the Node.js template

Greetings guys,

I tried to create a project through the template but in the express-generator version the are no choices.

It simply reads "Unavailable" and at the bottom of the window "Please specify yarn or npm package"

Now what i have done is go into the settings -> node and npm and select the npm10 file in "/usr/lib64/node_modules/ but i have noticed that npm installs packages in usr/local/lib/node_modules

The thing is that npm knows that and therefore so should webstorm so i don't see why it cannot find the express-generator.

 

The packages were installed using npm i -g <package>

 

Thanks in advance,

George

 

 

 

I am running

OpenSuse Leap 15.1

6 comments
Comment actions Permalink
 
 
>i have noticed that npm installs packages in usr/local/lib/node_modules. The thing is that npm knows that and therefore so should webstorm so i don't see why it cannot find the express-generator.
 

Initially, WebStorm installs specified version of express-generator package in temporary directory. Then WebStorm uses it to generate a new Express project. WebStorm doesn't use already installed express or express-generator packages.

Looks like it can't install packages because npm can't be found. Did yo try specifying a path to npm package (not binary) in new projects settings (File > New Projects Settings > Settings for New Projects, Settings | Languages & Frameworks | Node.js and NPM)?

0
Comment actions Permalink

Thank you for your comment Elena, i have actually tried to troubleshoot this based on your previous answers to such problems.

 

Running $ npm get prefix outputs /usr/local but going to /usr/local/lib/node_modules i only found the modules, not npm itself.

So i run npm -help to get it's location at /usr/lib64/node_modules/npm10 and linked the directory.

The difference between package and binary confuses me a bit though so i am not sure i'm approaching this correctly.

That being said i wanted to see the template, if i don't find a solution i can always create a blank project and npm my things locally.

 

 

0
Comment actions Permalink

>The difference between package and binary confuses me a bit though so i am not sure i'm approaching this correctly.

 

you did it right, as far as I can see

Does project creating work with these settings? If it doesn't, could you share your idea.log?

0
Comment actions Permalink

Well yes i can create a blank project as always and npm my modules locally.

The problem arises upon selecting the node.js template, since i cannot choose an express-generator version i do not have the choice of running it.

Here is the log but to save you some time i saw this.

2020-07-04 20:19:41,263 [ 30287] WARN - r.local.NodeJsLocalInterpreter - Failed to run 'npm config get prefix'
com.intellij.execution.ExecutionException: Please specify npm or yarn package

I also bolded it below

2020-07-04 20:19:11,152 [ 176] INFO - #com.intellij.idea.Main - IDE: WebStorm (build #WS-181.4892.44, 08 May 2018 17:11)
2020-07-04 20:19:11,152 [ 176] INFO - #com.intellij.idea.Main - OS: Linux (4.12.14-lp151.28.52-default, amd64)
2020-07-04 20:19:11,152 [ 176] INFO - #com.intellij.idea.Main - JRE: 1.8.0_152-release-1136-b38 (JetBrains s.r.o)
2020-07-04 20:19:11,152 [ 176] INFO - #com.intellij.idea.Main - JVM: 25.152-b38 (OpenJDK 64-Bit Server VM)
2020-07-04 20:19:11,157 [ 181] INFO - #com.intellij.idea.Main - JVM Args: -Xms128m -Xmx750m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -XX:ErrorFile=/home/george/java_error_in_WEBIDE_%p.log -XX:HeapDumpPath=/home/george/java_error_in_WEBIDE.hprof -Didea.paths.selector=WebStorm2018.1 -Djb.vmOptionsFile=/usr/lib64/webstorm/bin/webstorm64.vmoptions -Didea.platform.prefix=WebStorm
2020-07-04 20:19:11,157 [ 181] INFO - #com.intellij.idea.Main - ext: /usr/lib64/webstorm/jre64/lib/ext: [cldrdata.jar, dnsns.jar, jaccess.jar, jfxrt.jar, localedata.jar, meta-index, nashorn.jar, sunec.jar, sunjce_provider.jar, sunpkcs11.jar, zipfs.jar]
2020-07-04 20:19:11,157 [ 181] INFO - #com.intellij.idea.Main - JNU charset: UTF-8
2020-07-04 20:19:11,184 [ 208] INFO - #com.intellij.idea.Main - JNA library (64-bit) loaded in 27 ms
2020-07-04 20:19:21,457 [ 10481] INFO - #com.intellij.util.ui.JBUI - User scale factor: 1.0
2020-07-04 20:19:21,457 [ 10481] INFO - #com.intellij.util.ui.JBUI - System scale factor: 1.0 (IDE-managed HiDPI)
2020-07-04 20:19:22,440 [ 11464] INFO - .intellij.idea.IdeaApplication - CPU cores: 8; ForkJoinPool.commonPool: java.util.concurrent.ForkJoinPool@184ecae2[Running, parallelism = 7, size = 0, active = 0, running = 0, steals = 0, tasks = 0, submissions = 0]; factory: com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory@3ac83d5f
2020-07-04 20:19:22,504 [ 11528] INFO - .intellij.idea.IdeaApplication - WM detected: KWin
2020-07-04 20:19:23,927 [ 12951] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor js-nashorn-support.xml
2020-07-04 20:19:24,416 [ 13440] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor uml-java-support.xml
2020-07-04 20:19:24,417 [ 13441] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor uml-properties-support.xml
2020-07-04 20:19:25,246 [ 14270] INFO - llij.ide.plugins.PluginManager - 60 plugins initialized in 2389 ms
2020-07-04 20:19:25,248 [ 14272] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: ASP (0.1), AngularJS (181.4892.44), CSS Support (181.4892.44), CVS Integration (11), CoffeeScript (181.4892.44), Copyright (8.1), Cucumber.js (0.1), Dart (181.4892.44), Docker integration (181.4892.44), EJS (181.4892.44), EditorConfig (181.4892.44), File Watchers (181.4892.44), Gherkin (999.999), Git Integration (8.1), GitHub (181.4892.44), HTML Tools (2.0), HTTP Client (181.4892.44), Haml (181.4892.44), Handlebars/Mustache (181.4892.44), IDE Settings Sync (181.4892.44), IDEA CORE (181.4892.44), 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 (181.4892.44), Less support (181.4892.44), LiveEdit (181.4892.44), Mercurial Integration (10.0), Meteor (181.4892.44), Node.js Remote Interpreter (181.4892.44), NodeJS (181.4892.44), Perforce Integration (2.0), Performance Testing (181.4892.44), PhoneGap/Cordova Plugin (181.4892.44), Polymer & Web Components (999.999), Prettier (181.4892.44), Pug (ex-Jade) (181.4892.44), QuirksMode (181.4892.44), Refactor-X (2.01), Remote Hosts Access (0.1), SSH Remote Run (0.1), Sass support (181.4892.44), Settings Repository (181.4892.44), Spy-js (181.4892.44), Stylus support (999.999), Subversion Integration (1.1), Task Management (1.0), Terminal (0.1), TextMate bundles support (181.4892.44), Time Tracking (1.0), UML Support (1.0), Vagrant (181.4892.44), Vue.js (181.4892.44), W3C Validators (2.0), XPathView + XSLT Support (4), YAML (181.4892.44), Yeoman (181.4892.44), tslint (181.4892.44)
2020-07-04 20:19:25,928 [ 14952] INFO - cloudConfig.CloudConfigManager - === Start: JBA_NOT_CONNECTED ===
2020-07-04 20:19:26,055 [ 15079] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=500; buffer=10; max=705
2020-07-04 20:19:26,144 [ 15168] INFO - pl.local.NativeFileWatcherImpl - Starting file watcher: /usr/lib64/webstorm/bin/fsnotifier64
2020-07-04 20:19:26,164 [ 15188] INFO - pl.local.NativeFileWatcherImpl - Native file watcher is operational.
2020-07-04 20:19:27,436 [ 16460] WARN - nSystem.impl.ActionManagerImpl - keymap "Xcode" not found [Plugin: Git4Idea]
2020-07-04 20:19:27,495 [ 16519] WARN - nSystem.impl.ActionManagerImpl - keymap "Xcode" not found [Plugin: hg4idea]
2020-07-04 20:19:27,885 [ 16909] INFO - .openapi.application.Preloader - Finished preloading com.intellij.ide.ui.OptionsTopHitProvider$Activity@67cdeabe
2020-07-04 20:19:28,023 [ 17047] INFO - til.net.ssl.CertificateManager - Default SSL context initialized
2020-07-04 20:19:28,098 [ 17122] INFO - rains.ide.BuiltInServerManager - built-in server started, port 63342
2020-07-04 20:19:28,264 [ 17288] INFO - gs.impl.UpdateCheckerComponent - channel: release
2020-07-04 20:19:28,580 [ 17604] INFO - il.indexing.FileBasedIndexImpl - Index exts enumerated:100, number of extensions:36
2020-07-04 20:19:28,589 [ 17613] INFO - il.indexing.FileBasedIndexImpl - Index scheduled:8
2020-07-04 20:19:28,687 [ 17711] INFO - tellij.psi.stubs.StubIndexImpl - All stub exts enumerated:74, number of extensions:59
2020-07-04 20:19:28,688 [ 17712] INFO - tellij.psi.stubs.StubIndexImpl - stub exts update scheduled:0
2020-07-04 20:19:29,082 [ 18106] INFO - plication.impl.ApplicationImpl - 80 application components initialized in 6234ms
2020-07-04 20:19:29,086 [ 18110] INFO - .intellij.idea.IdeaApplication - App initialization took 18961 ms
2020-07-04 20:19:30,169 [ 19193] INFO - pl$FileIndexDataInitialization - Initialization done:1579
2020-07-04 20:19:30,264 [ 19288] INFO - exImpl$StubIndexInitialization - Initialization done:94
2020-07-04 20:19:31,579 [ 20603] INFO - .openapi.application.Preloader - Finished preloading com.intellij.openapi.actionSystem.impl.ActionPreloader@6f7942b7
2020-07-04 20:19:32,427 [ 21451] INFO - com.intellij.ide.ui.UISettings - Loaded: fontSize=12, fontScale=1.0; restored: fontSize=12, fontScale=1.0
2020-07-04 20:19:33,482 [ 22506] INFO - .openapi.application.Preloader - Finished preloading com.intellij.ide.ui.search.SearchableOptionPreloader@6088d7a3
2020-07-04 20:19:33,548 [ 22572] INFO - ellij.project.impl.ProjectImpl - 104 project components initialized in 2895 ms
2020-07-04 20:19:33,582 [ 22606] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2020-07-04 20:19:34,310 [ 23334] INFO - .openapi.application.Preloader - Finished preloading com.intellij.codeInsight.completion.CompletionPreloader@6c35d321
2020-07-04 20:19:34,326 [ 23350] INFO - .openapi.application.Preloader - Finished preloading com.intellij.ide.actions.GotoClassPresentationUpdater@5be21de7
2020-07-04 20:19:34,991 [ 24015] INFO - j.ide.script.IdeStartupScripts - 0 startup script(s) found
2020-07-04 20:19:35,426 [ 24450] WARN - om.intellij.util.ProfilingUtil - Profiling agent is not enabled. Add -agentlib:yjpagent to idea.vmoptions if necessary to profile IDEA.
2020-07-04 20:19:36,164 [ 25188] INFO - PerformancePlugin - Performance Plugin is in silent mode
2020-07-04 20:19:36,530 [ 25554] INFO - ellij.project.impl.ProjectImpl - 15 project components initialized in 67 ms
2020-07-04 20:19:36,699 [ 25723] INFO - .diagnostic.PerformanceWatcher - Post-startup activities under progress took 375ms; general responsiveness: ok; EDT responsiveness: ok
2020-07-04 20:19:37,862 [ 26886] INFO - cloudConfig.CloudConfigManager - === Start.updateInitStatus ===
2020-07-04 20:19:37,876 [ 26900] INFO - cloudConfig.CloudConfigManager - === StatusBar.update create ===
2020-07-04 20:19:37,877 [ 26901] INFO - cloudConfig.CloudConfigManager - === calculateInitStatus ===
2020-07-04 20:19:40,308 [ 29332] INFO - j.ide.ui.OptionsTopHitProvider - 1288 ms spent to cache options in application
2020-07-04 20:19:40,997 [ 30021] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 45ms; general responsiveness: ok; EDT responsiveness: ok
2020-07-04 20:19:41,032 [ 30056] INFO - Json.PackageJsonUpdateNotifier - processPackageJsonFiles []
2020-07-04 20:19:41,033 [ 30057] INFO - tartup.impl.StartupManagerImpl - /home/george/WebstormProjects/untitled/.idea case-sensitivity: expected=true actual=true
2020-07-04 20:19:41,084 [ 30108] INFO - pl.projectlevelman.NewMappings - VCS Root: [] - [<Project>]
2020-07-04 20:19:41,263 [ 30287] WARN - r.local.NodeJsLocalInterpreter - Failed to run 'npm config get prefix'
com.intellij.execution.ExecutionException: Please specify npm or yarn package
at com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter.invalidNpmPackage(NodeJsLocalInterpreter.java:417)
at com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter.getValidNpmCliJsFilePath(NodeJsLocalInterpreter.java:392)
at com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter.getValidNpmCliJsFilePath(NodeJsLocalInterpreter.java:375)
at com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter.getValidNpmCliJsFilePathOrDetect(NodeJsLocalInterpreter.java:337)
at com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter.doFetchConfigPrefix(NodeJsLocalInterpreter.java:318)
at com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter.lambda$fetchConfigPrefix$2(NodeJsLocalInterpreter.java:285)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2020-07-04 20:19:41,469 [ 30493] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 470ms; general responsiveness: ok; EDT responsiveness: ok
2020-07-04 20:19:41,831 [ 30855] INFO - tor.impl.FileEditorManagerImpl - Project opening took 11385 ms
2020-07-04 20:19:42,005 [ 31029] INFO - tartup.impl.StartupManagerImpl - Some post-startup activities freeze UI for noticeable time. Please consider making them DumbAware to do them in background under modal progress, or just making them faster to speed up project opening.
2020-07-04 20:19:42,006 [ 31030] INFO - tartup.impl.StartupManagerImpl - ProjectInspectionProfileStartUpActivity run in 101ms on UI thread
2020-07-04 20:19:42,062 [ 31086] INFO - cloudConfig.CloudConfigManager - === StatusBar.start another widget: com.intellij.cloudConfig.StatusBarInfoManager$InfoComponent@9b8df7a ===
2020-07-04 20:19:42,812 [ 31836] INFO - j.ide.ui.OptionsTopHitProvider - 454 ms spent to cache options in project
2020-07-04 20:19:44,213 [ 33237] INFO - .cloudConfig.CloudConfigClient - === Get cloud config URL: https://cloudconfig.jetbrains.com/cloudconfig/files ===
2020-07-04 20:19:44,801 [ 33825] INFO - cloudConfig.CloudConfigManager - === calculateInitStatus.value: JBA_NOT_CONNECTED ===
2020-07-04 20:19:44,809 [ 33833] INFO - cloudConfig.CloudConfigManager - === End.updateInitStatus ===
2020-07-04 20:20:16,571 [ 65595] INFO - pl.ProjectRootManagerComponent - project roots have changed
2020-07-04 20:20:16,653 [ 65677] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 3ms; general responsiveness: ok; EDT responsiveness: ok
2020-07-04 20:20:16,685 [ 65709] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 30ms; general responsiveness: ok; EDT responsiveness: ok

0
Comment actions Permalink

Hmm... could you check if it's still an issue in the most recent WS version (2020.1.2)? A pair of related issues has been fixed sine 2018.1.x

0
Comment actions Permalink

Yep, that fixed the problem.

 

Thanks for your help Elena

0

Please sign in to leave a comment.