我正在进入Node.js代码库,这需要我通过NPM下载一些依赖项,即jQuery.
在尝试运行时npm install jquery,我不断收到此错误:
Your environment has been set up for using Node.js 0.8.21 (x64) and NPM
C:\Users\Matt Cashatt>npm install jquery
npm http GET https://registry.npmjs.org/jquery
npm http 304 https://registry.npmjs.org/jquery
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/xmlhttprequest
npm http GET https://registry.npmjs.org/htmlparser/1.7.6
npm http GET https://registry.npmjs.org/location/0.0.1
npm http GET https://registry.npmjs.org/navigator
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser/1.7.6
npm http 304 https://registry.npmjs.org/xmlhttprequest
npm http 304 https://registry.npmjs.org/location/0.0.1
npm http 304 https://registry.npmjs.org/navigator
npm http 304 https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/contextify
npm …Run Code Online (Sandbox Code Playgroud) 我不是百分百肯定,但我相信我在家用和办公室PC上安装了Windows安装程序的v5节点.
在我的家用电脑上,全局安装发生在%APPDATA%下:
(dev) go|c:\srv> which lessc
c:\users\bjorn\appdata\roaming\npm\lessc
c:\users\bjorn\appdata\roaming\npm\lessc.cmd
Run Code Online (Sandbox Code Playgroud)
在我的办公室电脑上,他们在程序文件下:
(dev) go|w:\srv> which lessc
c:\program files\nodejs\lessc
c:\program files\nodejs\lessc.cmd
Run Code Online (Sandbox Code Playgroud)
我需要向PyCharm的文件监视器提供许多这些全局工具的完整路径,并且由于我共享它的项目文件,因此在用户文件夹下没有全局资源是有意义的.
为什么全局安装最终会出现在不同的文件夹中,如何强制它们到达所有团队成员共有的位置?
我正在尝试使用npm 安装ESLint:
npm install -g eslint
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
Deans-Air:~ deangibson$ npm install -g eslint
npm ERR! tar.unpack untar error /Users/deangibson/.npm/eslint/2.4.0/package.tgz
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "eslint"
npm ERR! node v4.2.3
npm ERR! npm v2.14.7
npm ERR! path /usr/local/lib/node_modules/eslint
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/eslint'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/eslint']
npm …Run Code Online (Sandbox Code Playgroud) 下载安装程序失败。错误:TypeError:“process.env”仅接受可配置、可写和可枚举的数据描述符。
我已经运行这个命令 npm install --global windows-build-tools
节点版本:v18.12.0 NPM版本:8.19
有没有人成功地做到了这一点?我目前已node-sass安装在我的 CRA 项目中,我正在尝试替换它,dart-sass但遇到了困难,因为 CRA 错误输出告诉我我需要node-sass安装。有什么方法可以让底层 CRA 配置知道使用我安装的dart-sass包而不是node-sass?
我正在尝试为Exokit安装必要的依赖项,但是却收到与Python语法错误有关的错误。
这是我想尝试在浏览器中涉及VR的新内容。我已经从他们的github重新克隆了存储库,并直接从他们的网站下载了。我按照对T的指示进行操作(其中只有4个笑声)。
I have not yet touched the code and this is the error that I am getting.
Austin@DESKTOP-UD2R1O4 MINGW64 ~/exokit (master)
$ npm install
> raw-buffer@0.0.19 install C:\Users\Austin\exokit\node_modules\raw-buffer
> node-gyp rebuild
C:\Users\Austin\exokit\node_modules\raw-buffer>if not defined
npm_config_node_gyp (node "C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-
bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node
"C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\Austin\Anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" …Run Code Online (Sandbox Code Playgroud) 所以我试图让Node.js工作.当然,它并不像宣传的那样容易:)
我碰巧在我的计算机上有两个python版本,但Node.js似乎只适用于较旧的版本,2.7.出错时,它还鼓励我将路径设置为PYTHON环境变量,并显示以下错误:
Error: Can't find Python executable "python2.7", you can set the PYTHON env variable.
Run Code Online (Sandbox Code Playgroud)
好的,我根据需要配置了变量:
C:\Users\Jakub>set PYTHON=C:\MYSELF\Programs\Python2.7\python.exe
C:\Users\Jakub>echo %PYTHON%
C:\MYSELF\Programs\Python2.7\python.exe
Run Code Online (Sandbox Code Playgroud)
你可以看到我曾经echo检查变量是否真的设置过.不幸的是,那npm东西无法读取它并且错误再次出现.这是我设置%PYTHON%变量后的完整日志:
C:\Users\Jakub>npm install minecraft-protocol
\
> ursa@0.8.5 install C:\Users\Jakub\node_modules\minecraft-protocol\node_modules\ursa
> node-gyp rebuild
|
C:\Users\Jakub\node_modules\minecraft-protocol\node_modules\ursa>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\no
de_modules\node-gyp\bin\node-gyp.js" rebuild ) else (rebuild)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python2.7", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython …Run Code Online (Sandbox Code Playgroud) 我试图安装 Sharp 模块,它需要: c++ 编译器 - 我下载了 Visual Studio 2017 和 Visual C++ 构建工具 node-gyp - 它已成功安装
但是运行“npm install -g Sharp”我遇到了很多错误
E:\VS\MSBuild\15.0\Bin\MSBuild.exe失败,退出代码:1我正在尝试通过运行以下命令来安装 --global windows-build-tools
npm install --global windows-build-tools -verbose
无论我尝试通过 PowerShell 还是 CMD(均以管理员身份),安装都会陷入同一步骤。
npm info run windows-build-tools@5.2.2 postinstall node_modules/windows-build-tools node ./dist/index.js
[##################] | reify:resolve: info run windows-build-tools@5.2.2 postinstall node_modules/windows-build-tools node ./dist/index.js
这可能无法完成有什么原因吗?
我很难在 npm 上安装 node-sass,我尝试执行以下步骤:
不断弹出的错误代码是:
found 0 vulnerabilities
Invoking generators...
Installing additional dependencies...
npm ERR! code 1
npm ERR! path C:\Users\Hogar\pvgzcms\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\Hogar\pvgzcms\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe', …Run Code Online (Sandbox Code Playgroud)尝试在项目中安装node_modules时,出现大量错误消息。我以前已经成功安装了它,但是我不确定我做错了什么导致现在生成所有这些错误消息。
任何有助于理解其含义的帮助都将是巨大的。在此之前,我做了以下grpc安装,安装了v1.14.1:
$ npm install -g grpc@latest
grpc@1.14.1 install /usr/local/lib/node_modules/grpc
node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using needle for node-pre-gyp https download
[grpc] Success: "/usr/local/lib/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" is installed via remote
+ grpc@1.14.1
added 85 packages from 48 contributors in 6.344s
Run Code Online (Sandbox Code Playgroud)
所以很好奇节点为什么要在以下消息中使用v1.10.1:
$ npm i
> fsevents@1.2.4 install /path/to/app/node_modules/fsevents
> node install
[fsevents] Success: "/path/to/app/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> grpc@1.10.1 install /path/to/app/node_modules/@firebase/firestore/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-darwin-x64-unknown.tar.gz
node-pre-gyp ERR! …Run Code Online (Sandbox Code Playgroud) 插件“gulp-sass”错误消息:
gulp-sass 5 没有默认的 Sass 编译器;请自己设置一个。无论是sass和node-sass包都是允许的。例如,在你的 gulpfile 中:
var sass = require('gulp-sass')(require('sass'));
Run Code Online (Sandbox Code Playgroud)
这是我下面的代码。它说 var sass = require('gulp-sass')(require('sass')); 在错误中,但我正在使用导入,但没有一个解决方案对我有用我是新手,cli 版本是 2.3.0 本地版本是 4.0.2 请给我一个解决方案
import gulp from 'gulp';
import sass from 'gulp-sass';
import yargs from 'yargs';
const PRODUCTION = yargs.argv.prod;
export const styles = () => {
return gulp.src('src/assets/scss/bundle.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('dist/asset/css'));
}
Run Code Online (Sandbox Code Playgroud)