简体   繁体   English

WebStorm-未定义Node.jS process.env.PWD

[英]WebStorm - Node.jS process.env.PWD is undefined

I'm running a node.js application through WebStorm. 我正在通过WebStorm运行node.js应用程序。 The application includes other modules/etc though mechanisms like this; 该应用程序包括其他模块/等机制,例如:

utils = require "#{process.env.PWD}/utils.coffee"

When I run my app from the CLI using this command: 当我使用以下命令从CLI运行应用程序时:

node server

Everything works fine. 一切正常。

When I run the app from within WebStorm, the PWD in process.env.PWD is undefined and the app crashes. 当我从内WebStorm运行应用程序时, PWDprocess.env.PWD是不确定和应用程序崩溃。

I've enabled the Node.js Core Library in WebStorm preferences and I'm still having this issue? 我已在WebStorm首选项中启用了Node.js核心库,但仍然遇到此问题?

What am I doing wrong or what setting am I missing that would make PWD undefined in this instance? 我做错了什么或缺少什么设置会使PWD在这种情况下未定义? Or, is there a workaround? 还是有解决方法?

看起来非常类似于https://youtrack.jetbrains.com/issue/RUBY-16153 ,我认为我们没有正确设置PWD变量,让我看看这里可以解决的问题

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

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