草庐IT

WHOLE_MODULE_OPTIMIZATION

全部标签

node.js - NPM 全局安装 "cannot find module"

我写了一个模块,我刚才发布到npm(https://npmjs.org/package/wisp)所以它可以从命令行正常安装:$npmi-gwisp但是,当我从命令行运行它时,我不断收到一个未安装optimist的错误:$wispError:Cannotfindmodule'optimist'atFunction.Module._resolveFilename(module.js:338:15)atFunction.Module._load(module.js:280:25)atModule.require(module.js:362:17)atrequire(module.js:37

node.js - 错误 : Cannot find module '../lib/utils/unsupported.js' while using Ionic

我在运行“Ionic启动项目名称”时总是收到此错误消息:错误信息Runningcommand-failed![ERROR]Anerroroccurredwhilerunningnpminstall(exitcode1):module.js:471throwerr;^Error:Cannotfindmodule'../lib/utils/unsupported.js'atFunction.Module._resolveFilename(module.js:469:15)atFunction.Module._load(module.js:417:25)atModule.require(mo

node.js - Node.js 和 ES6 中的 module.exports 与 export default

Node的module.exports和ES6的exportdefault有什么区别?我试图弄清楚为什么在Node.js6.2.2中尝试exportdefault时出现“__不是构造函数”错误。什么有效'usestrict'classSlimShady{constructor(options){this._options=options}sayName(){return'MynameisSlimShady.'}}//Thisworksmodule.exports=SlimShady什么不起作用'usestrict'classSlimShady{constructor(options){

windows - 无法创建 Windows docker 机器? "Hyper-V PowerShell Module is not available"

我刚刚安装了docker并尝试创建一个Windows(不是Linux)的docker机器但是失败了?PSC:\>docker-machine.execreate--driverhypervdefaultCreatingCA:C:\Users\...\.docker\machine\certs\ca.pemCreatingclientcertificate:C:\Users\...\.docker\machine\certs\cert.pemRunningpre-createchecks...Errorwithpre-createcheck:"Hyper-VPowerShellModul

powershell - Docker 机器错误 : Hyper-V PowerShell Module is not available

我检查了我的Hyper-V设置并启用了PowerShell模块。我还发现了这个记录在案的问题:https://github.com/docker/machine/issues/4342但这不是同一个问题,因为我没有安装VMwarePowerCLI。该问题已通过推送到存储库而关闭,据说已在0.14.0-rc1中修复,构建e918c74所以我还是尝试了它。更换我的docker-machine.exe后,我仍然收到错误,即使我重新安装Windows版Docker,我仍然收到错误。了解更多背景信息,此错误在重新安装后开始发生,因为我的Docker安装出现错误:https://github.co

Python 多处理错误 : AttributeError: module '__main__' has no attribute '__spec__'

我正在使用Python3.6,并尝试遵循下面网站上的第一个示例(完整代码也在下面)并且收到以下错误:https://docs.python.org/3.6/library/multiprocessing.html错误信息:AttributeError:模块'__main__'没有属性'__spec__'完整示例代码:frommultiprocessingimportPooldeff(x):returnx*xif__name__=='__main__':withPool(5)asp:print(p.map(f,[1,2,3]))我尝试用谷歌搜索它并搜索StackOverflow,但我只发

python - 为什么 python 说我有 "no module named venv"?

我用sudopipinstallvirtualenv安装了虚拟环境,但是当我运行python-mvenvflask我仍然得到这个:/usr/bin/python:没有名为venv的模块版本,如果相关的话:pip1.5.6from/usr/lib/python2.7/dist-packages(python2.7)Python2.7.9我在这里错过了什么? 最佳答案 由于您使用的是Python2,因此您需要使用您安装的virtualenv模块执行。第一步,正如您最初尝试做的那样,但这次您指定了“virtualenv”模块和virtua

python - 属性错误 : 'module' object has no attribute 'utcnow'

当我输入简单代码时:importdatetimedatetime.utcnow(),我收到错误消息:Traceback(mostrecentcalllast):File"",line1,indatetime.utcnow()AttributeError:'module'objecthasnoattribute'utcnow'但是utcnow的python文档就在这里:https://docs.python.org/library/datetime.html#datetime.datetime.utcnow.为什么utcnow在我的电脑上不起作用?谢谢! 最佳

python - tqdm: 'module' 对象不可调用

我这样导入tqdm:importtqdm我正在使用tqdm在我的python3代码中显示进度,但出现以下错误:Traceback(mostrecentcalllast):File"process.py",line15,infordirintqdm(os.listdir(path),desc='dirs'):TypeError:'module'objectisnotcallable代码如下:path='../dialogs'dirs=os.listdir(path)fordirintqdm(dirs,desc='dirs'):print(dir) 最佳答案

python - PyCharm:DJANGO_SETTINGS_MODULE 未定义

我正在使用PyCharmIDE,当我运行任何file.py时出现此错误:..raiseImportError("Settingscannotbeimported,becauseenvironmentvariable%sisundefined."%ENVIRONMENT_VARIABLE)ImportError:Settingscannotbeimported,becauseenvironmentvariableDJANGO_SETTINGS_MODULEisundefined.如何在PyCharm中配置DJANGO_SETTINGS_MODULE环境变量?