我从主页面下载了nodejs的Windows二进制文件(.exe).
我如何安装和使用npm(节点包管理器)?
我在Surface Pro 3上安装了Rails,并在尝试查看页面后遇到此错误.我已经尝试了一些建议,比如用libv8安装rubyracer,但它没有帮助.
TypeError:Object不支持此属性或方法(在c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js中.咖啡)
这是我的gemfile:
source 'http://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript …Run Code Online (Sandbox Code Playgroud) 我刚刚在Windows 8的新计算机上安装了Nodejs.我无法让npm处理它.虽然节点服务器启动正常:
这是错误:
C:\Users\User\Documents\Source\Project>npm install
Error: ENOENT, stat 'C:\Users\User\AppData\Roaming\npm'
C:\Users\User\Documents\Source\Project>npm start
Error: ENOENT, stat 'C:\Users\User\AppData\Roaming\npm'
C:\Users\User\Documents\Source\Project>
Run Code Online (Sandbox Code Playgroud) 我遇到了严重的问题,让我的TeamCity配置的最后部分到位.
我有一个执行以下命令的powershell步骤:
& npm install
& grunt build
Run Code Online (Sandbox Code Playgroud)
记录以下输出:
Build (Powershell) (1s)
[13:18:08]PowerShell Executable: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
[13:18:08]Working directory: C:\BuildAgent\work\6a434ee5d01fd0d9
[13:18:08]PowerShell arguments: [-NonInteractive, -ExecutionPolicy, ByPass, -File, C:\BuildAgent\temp\buildTmp\powershell8407335260182621582.ps1]
[13:18:09]Error: ENOENT, stat 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
[13:18:09]
[13:18:09]grunt-cli: The grunt command line interface. (v0.1.13)
[13:18:09]Process exited with code 0
Run Code Online (Sandbox Code Playgroud)
我已经看到这是一个已知的问题,但迄今为止没有一个解决方案对我有用.
我的设置如下:我在Azure中有两个虚拟机,build和agent.两者都连接到同一个AD域,domain其中有一个用户domain\teamcityuser,他是"标准"类(即不是管理员).此用户同时运行构建服务器(在build实例上)和构建代理(在agent实例上).
我尝试过这些事情没有成功:
domain\teamcityuser具有对其的完全控制访问权限.npm在.下创建目录C:\Users\teamcityuser\AppData\RoamingC:\Windows\System32\config\SystemProfile\.npmrc包含内容的文件prefix=C:\npm-global,以及创建后一个文件夹npm cache clean运行构建之前npm …围绕微软的botframework,当我尝试运行机器人的主要文件app.js文件时,第一次没问题,在我关闭机器人模拟器和所有程序之后,再次运行app.js,弹出此错误消息
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3978
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Server.listen (C:\Users\yu\Documents\GitHub\BotBuilder-
Samples\Node\cards-AdaptiveCards\node_modules\restify\lib\server.js:404:32)
at Object.<anonymous> (C:\Users\yu\Documents\GitHub\BotBuilder-
Samples\Node\cards-AdaptiveCards\app.js:10:8)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
Run Code Online (Sandbox Code Playgroud)
我找到了一些解决方案,看起来我第二次运行js文件时采用了端口3978,我必须使用cmd查找哪个任务正在使用该端口,然后终止任务.
C:\>netstat -aon|findstr 3978
Run Code Online (Sandbox Code Playgroud)
所以这个人正在接收港口,虽然我已经关闭了所有程序
TCP 0.0.0.0:3978 0.0.0.0:0 LISTENING 13140
TCP [::]:3978 [::]:0 LISTENING 13140
Run Code Online (Sandbox Code Playgroud)
实际上它是node.exe本身,它仍然在后台运行
C:\Users\yu>tasklist|findstr 13140
node.exe 13140 Console 1 42,064 K
Run Code Online (Sandbox Code Playgroud)
我需要杀死它
C:\Users\yu>taskkill /f /t /im node.exe
Run Code Online (Sandbox Code Playgroud)
当我想多次运行该文件时,有没有办法不总是重复这样做,它今天才开始连线,我的意思是所有不同的app.js文件,包括官方示例代码.在过去的一个月里,一切都很好,我使用的IDE是sublime text 3,node.js版本是8.9.4 …
我正在尝试通过运行以下命令来创建 React 应用程序样板
npx create-react-app my-app
我收到以下错误
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\dejean\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\dejean\AppData\Roaming\npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dejean\AppData\Local\npm-cache\_logs\2023-06-27T18_53_22_682Z-debug-0.log
Run Code Online (Sandbox Code Playgroud)
我使用节点 18.16.1 和 npm 9.5.1
node.js ×4
npm ×4
azure ×1
botframework ×1
javascript ×1
npx ×1
powershell ×1
reactjs ×1
sublimetext ×1
teamcity ×1
teamcity-9.1 ×1
windows ×1