我正在尝试运行从命令提示符调用PowerShell脚本的.cmd文件,我收到以下错误:
无法加载Management_Install.ps1,因为在此系统上禁用了脚本的执行.
我跑了cmd.exe,当我Management_Install.ps1从PowerShell 运行时,我Get-ExecutionPolicy回来了.
// Powershell的输出
PS C:\ Users\Administrator> get-executionpolicy
无限制
//从DOS输出
C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scr
ipts> powershell.\ Management_Install.ps1 1
警告:运行x86 PowerShell ...
无法加载文件C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\Management_Install.ps1,因为在此系统上禁用了脚本的执行.有关详细信息,请参阅"get-help about_signing".
在线:1个字符:25
.\ Management_Install.ps1 <<<< 1
CategoryInfo:NotSpecified:(:) [],PSSecurityException
FullyQualifiedErrorId:RuntimeException
C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts> pause
按任意键继续 ...
该系统是Windows Server 2008 R2.
我究竟做错了什么?
我做了以下更新我的npm:
npm update npm -g
Run Code Online (Sandbox Code Playgroud)
但我不知道如何更新Node.js. 有什么建议?(我正在使用Node.js 0.4.1并希望更新到Node.js 0.6.1.)
目前我的机器上安装了TypeScript 1.0.3.0版本.
我想将它更新到最新的即2.0.
如何用npm做到这一点?
当我从msi(http://nodejs.org/download/)安装节点0.10.33时,我得到了旧版本的npm(1.4.28).如何在Windows上升级npm?
npm install -g npm
不起作用; 我还有旧的npm.
我遇到的问题是Windows 10中的Visual Studio Code无法检测集成终端中全局安装的NPM包.
例如,如果windows命令提示我@angular/cli通过命令安装npm install -g @angular/cli,在该命令提示符下我可以执行@ angular/cli命令,例如ng --version没有错误.在全局npm模块安装之后,在Visual Studio Code中,执行相同操作ng --version会给出错误:
术语"ng"不被识别为cmdlet,函数,脚本文件或可操作程序的名称.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试.
但是,我可以在集成终端内成功执行诸如npm -v和之类的命令node -v.
我的系统环境变量中有以下项目
C:\Program Files\nodejs\
%AppData%\npm
是否缺少Visual Studio Code用户或系统环境变量以允许检测全局npm模块?
感谢您提供任何帮助.
我正在使用Windows 8.1 x64进行所有更新.
我使用的是nodejs 8.9.1 - 我在命令"npm -v"上发生错误.
所以我卸载了这个版本并安装了8.9.3.它给了我同样的错误命令.
然后我卸载了8.9.3并使用这个答案清理所有路径;
/sf/answers/1449798731/
然后安装新版本9.3.0 ...
但是,我在所有npm命令中都遇到了同样的错误.
我错过了什么?我怎么解决这个问题?
C:\Users\UserName\Desktop>npm -v
Error: spawn C:\Program Files\nodejs\node.exe ENOENT
at _errnoException (util.js:999:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
at onErrorNT (internal/child_process.js:389:16)
at process._tickCallback (internal/process/next_tick.js:152:19)
at Function.Module.runMain (module.js:703:11)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:618:3
C:\Program Files\nodejs\node_modules\npm\lib\npm.js:51
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.get (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:51:13)
at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at process.emit (events.js:159:13)
at process._fatalException (bootstrap_node.js:387:26)
5.5.1
events.js:136
throw er; // Unhandled 'error' event
^
Error: spawn C:\Program Files\nodejs\node.exe ENOENT …Run Code Online (Sandbox Code Playgroud) 我尝试了很多方法。但我找不到任何解决办法。问题是我无法在我的系统中安装 ReactJS。这是我完成安装过程时收到的消息。
未提供模板。这可能是因为您使用的是过时版本的 create-react-app。请注意,不再支持 create-react-app 的全局安装。
我清理了缓存。我还看到它有一个新的节点,甚至想尝试卸载 create-react-app。但如果我这样做,我就会收到这条消息。
我手动删除了这个日志,没有效果。
谁能建议我任何解决方案?
更新:实际上,当我从 AppData\Roaming\npm (temp) 目录中手动删除缓存时,这两个问题就得到了解决。
感谢大家
当我在终端上运行“ npm install npm@latest -g ”脚本时
它显示这样的错误
PS C:\xampp\htdocs\laravelecommerce3> npm install npm@latest -g
npm WARN npm npm does not support Node.js v16.10.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/ …Run Code Online (Sandbox Code Playgroud) 我正在建立一个AutoCI - > Jenkins - > Octopus自动构建过程.我使用一个名为octopackjs和gulp-octo的包将我的node.js项目打包成.tar文件,如下所示:
return gulp.src(['**/*', '!gulpfile.js'])
.pipe(octo.pack("tar.gz"))
.pipe(octo.push({apiKey: 'API-SUPERCOOLKEY', host: 'https://octopus.supercooldomain.net', replace: true}));
Run Code Online (Sandbox Code Playgroud)
我可以收拾它,并将它推到Octopus服务器的正确位置.但是,当我检查该.tar文件的内容时,它会被数百个名为"PaxHeader"的文件污染.从一些环顾来看,该文件旨在包含.tar包的元数据.当Octopus尝试将该文件解压缩到我的目标环境时,它会抛出以下错误跟踪:
System.IO.IOException: Cannot create /home/opsteam/.octopus/Applications/OctopusServer/Dev.Corporate/webapp/2.0.10/PaxHeader because a file with the same name already exists.
09:46:34Error
at System.IO.Directory.CreateDirectory (System.String path) <0x7fdc9e79db50 + 0x00167> in <filename unknown>:0
09:46:34Error
at SharpCompress.Reader.IReaderExtensions.WriteEntryToDirectory (IReader reader, System.String destinationDirectory, ExtractOptions options) <0x4033e800 + 0x00260> in <filename unknown>:0
09:46:34Error
at Calamari.Integration.Packages.TarPackageExtractor.Extract (System.String packageFile, System.String directory, Boolean suppressNestedScriptWarning) <0x4033b4f0 + 0x000f3> in <filename unknown>:0
09:46:34Error
at Calamari.Integration.Packages.GenericPackageExtractor.Extract (System.String packageFile, System.String directory, Boolean …Run Code Online (Sandbox Code Playgroud) 我曾经有角度cli,但我错误地再次安装它
npm install -g angular-cli
Run Code Online (Sandbox Code Playgroud)
现在,当我运行ng serve它抱怨:
It seems like you're using a project generated using an old version of the Angular CLI.
The latest CLI now uses webpack and includes a lot of improvements, include a simpler
workflow, a faster build and smaller bundles.
To get more info, including a step-by-step guide to upgrade the CLI, follow this link:
https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.12
Run Code Online (Sandbox Code Playgroud)
当我尝试ng new在另一个目录中创建一个新项目时 ,它会抱怨:
Cannot find module 'reflect-metadata'
Run Code Online (Sandbox Code Playgroud)
那么问题是什么?
node.js ×6
npm ×6
javascript ×2
windows ×2
angular ×1
angular-cli ×1
deployment ×1
npm-install ×1
octopus ×1
powershell ×1
reactjs ×1
tar ×1
typescript ×1