moonrepo / proto

A pluggable multi-language version manager.
https://moonrepo.dev/proto
MIT License
643 stars 30 forks source link

Changed node version, but npm version not auto-switch. #382

Closed ImBIOS closed 8 months ago

ImBIOS commented 8 months ago

What version?

0.27.1

Which command?

npm run XXX

What happened?

I need to check on a legacy project from years back. and install specific node version proto install node 14.19.1, but when I ran npm run XXX, it says:

ERROR: npm v10.2.3 is known not to run on Node.js v14.19.1.  This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.

Trace logs?

[DEBUG 2024-01-08 09:57:00.643] proto  Running proto v0.27.1  bin="/Users/ImBIOS/.proto/bin/proto" args=["run", "npm", "--", "run", "watch:js"] shim="npm" shim_bin="/Users/ImBIOS/.proto/shims/npm" pid=57679
[TRACE 09:57:00.644] starbase::app  Running startup phase with 3 systems 
[DEBUG 09:57:00.644] proto_core::proto:detect_proto_env  Creating proto environment, detecting store  store="/Users/ImBIOS/.proto"
[TRACE 09:57:00.644] starbase::app  Running analyze phase with 3 systems 
[TRACE 09:57:00.644] proto_core::proto_config:load_proto_configs  Traversing upwards and loading .prototools files 
[DEBUG 09:57:00.645] proto_core::proto_config:load_proto_configs  Loading .prototools  file="/Users/ImBIOS/.proto/.prototools"
[TRACE 09:57:00.645] starbase_utils::fs:load_proto_configs  Opening file  file="/Users/ImBIOS/.proto/.prototools"
[TRACE 09:57:00.645] starbase_utils::fs_lock:load_proto_configs  Locking file  file="/Users/ImBIOS/.proto/.prototools"
[TRACE 09:57:00.645] starbase_utils::fs_lock:load_proto_configs  Unlocking file  file="/Users/ImBIOS/.proto/.prototools"
[TRACE 09:57:00.645] schematic::config::loader:load_proto_configs  Loading partial configuration  config="ProtoConfig"
[TRACE 09:57:00.645] schematic::config::loader:load_proto_configs  Creating layer from source  config="ProtoConfig" source="<code>"
[TRACE 09:57:00.645] schematic::config::loader:load_proto_configs  Merging partial layers into a final result  config="ProtoConfig"
[DEBUG 09:57:00.645] proto_core::proto_config:load_proto_configs  Merging loaded configs 
[DEBUG 09:57:00.645] proto_core::proto_config:load_proto_configs  Merged 1 configs 
[TRACE 09:57:00.645] starbase::app  Running execute phase with 2 systems 
[DEBUG 09:57:00.645] proto_core::tool_loader:run  Finding a configured plugin  tool="npm"
[DEBUG 09:57:00.645] proto_core::tool_loader:run  Using a built-in plugin  plugin="source:https://github.com/moonrepo/node-plugin/releases/download/v0.7.0/node_depman_plugin.wasm"
[TRACE 09:57:00.645] warpgate::loader:run  Creating plugin loader  cache_dir="/Users/ImBIOS/.proto/plugins"
[TRACE 09:57:00.645] warpgate::loader:run  Loading plugin npm  plugin="npm"
[TRACE 09:57:00.645] starbase_utils::fs:run  Reading file metadata  file="/Users/ImBIOS/.proto/plugins/npm-af8d83211d5218eba0df07873ea3990c74f1596aaa0f43e156a7b4b7609b96c3.wasm"
[TRACE 09:57:00.645] warpgate::loader:run  Plugin already downloaded and cached  plugin="npm" path="/Users/ImBIOS/.proto/plugins/npm-af8d83211d5218eba0df07873ea3990c74f1596aaa0f43e156a7b4b7609b96c3.wasm"
[DEBUG 09:57:00.645] proto_core::tool_loader:run  Loading WASM plugin  source="/Users/ImBIOS/.proto/plugins/npm-af8d83211d5218eba0df07873ea3990c74f1596aaa0f43e156a7b4b7609b96c3.wasm"
[TRACE 09:57:00.645] proto_core::tool_loader:run  Storing tool identifier  id="npm"
[TRACE 09:57:00.645] proto_core::tool_loader:run  Storing proto environment  env={"arch":"arm64","os":"macos","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"/Users/ImBIOS"},"proto_dir":{"path":"/proto/","virtual_prefix":"/proto","real_prefix":"/Users/ImBIOS/.proto"}}
[DEBUG 09:57:00.645] proto_core::tool:run  Creating tool npm and instantiating plugin 
[DEBUG 09:57:00.645] proto_core::tool_manifest:run  Loading manifest.json  file="/Users/ImBIOS/.proto/tools/npm/manifest.json"
[TRACE 09:57:00.645] starbase_utils::fs:run  Opening file  file="/Users/ImBIOS/.proto/tools/npm/manifest.json"
[TRACE 09:57:00.645] starbase_utils::fs_lock:run  Locking file  file="/Users/ImBIOS/.proto/tools/npm/manifest.json"
[TRACE 09:57:00.645] starbase_utils::fs_lock:run  Unlocking file  file="/Users/ImBIOS/.proto/tools/npm/manifest.json"
[DEBUG 09:57:00.657] proto_core::tool:run  Created tool npm and its WASM runtime 
[TRACE 09:57:00.657] warpgate::plugin:run  Calling plugin function register_tool  plugin="npm" input={"id":"npm"}
[TRACE 09:57:00.657] warpgate::plugin:run  Called plugin function register_tool  plugin="npm" output={"default_version":"bundled","inventory":{},"name":"npm","plugin_version":"0.7.0","type":"DependencyManager"}
[TRACE 09:57:00.657] proto_core::version_detector:run  Attempting to find version from .prototools files  tool="npm"
[TRACE 09:57:00.657] warpgate::plugin:run  Calling plugin function detect_version_files  plugin="npm" input={}
[TRACE 09:57:00.657] warpgate::plugin:run  Called plugin function detect_version_files  plugin="npm" output={"files":["package.json"],"ignore":["node_modules"]}
[TRACE 09:57:00.657] proto_core::tool:run  Attempting to detect a version from directory  tool="npm" dir="/Users/ImBIOS/itmi-id/itmi-admin"
[TRACE 09:57:00.657] starbase_utils::fs:run  Reading file  file="/Users/ImBIOS/itmi-id/itmi-admin/package.json"
[TRACE 09:57:00.657] warpgate::plugin:run  Calling plugin function parse_version_file  plugin="npm" input={"content":"{\n    \"name\": \"admin-backend\",\n    \"version\": \"1.0.0\",\n    \"description\": \"admin backend\",\n    \"main\": \"server.js\",\n    \"scripts\": {\n        \"start\": \"nodemon --ignore 'public/*'\",\n        \"debug\": \"node --nolazy --inspect-brk server.js\",\n        \"test\": \"NODE_ENV=test SERVER_PORT=5001 nyc --reporter=lcov --reporter=text --reporter=text-summary mocha tests/**/**/*.test.js --timeout 100000 --exit\",\n        \"seed\": \"npx sequelize-cli db:seed --seed 20190827065557-admin-table-seeder.js 20190823092852-module-table-seeder.js 20190823093217-permission-table-seeder.js 20190826045401-role-table-seeder.js 20190829061227-role-permissions-seeder.js 20200205071518-setting-table-seeder.js\",\n        \"db:reset\": \"sequelize-cli db:drop && sequelize-cli db:create && sequelize-cli db:migrate && sequelize-cli db:seed:all\",\n        \"lint\": \"eslint --ext .js ./\",\n        \"watch:js\": \"cd ./public && gulp watcher\"\n    },\n    \"repository\": {\n        \"type\": \"git\",\n        \"url\": \"git+https://github.com/itmi-id/itmi-admin.git\"\n    },\n    \"keywords\": [\n        \"nodejs\",\n        \"expressjs\"\n    ],\n    \"author\": \"\",\n    \"license\": \"ISC\",\n    \"bugs\": {\n        \"url\": \"https://github.com/itmi-id/itmi-admin/issues\"\n    },\n    \"homepage\": \"https://github.com/itmi-id/itmi-admin#readme\",\n    \"dependencies\": {\n        \"@creativebulma/bulma-tooltip\": \"^1.2.0\",\n        \"amqplib\": \"^0.5.5\",\n        \"axios\": \"^0.19.0\",\n        \"bcryptjs\": \"^2.4.3\",\n        \"body-parser\": \"^1.19.0\",\n        \"buffer-image-size\": \"^0.6.4\",\n        \"connect-redis\": \"^4.0.3\",\n        \"csvtojson\": \"^2.0.10\",\n        \"docx\": \"^7.3.0\",\n        \"dotenv\": \"^8.1.0\",\n        \"elastic-apm-node\": \"^2.16.2\",\n        \"eslint\": \"^5.3.0\",\n        \"eslint-config-airbnb\": \"^17.1.1\",\n        \"eslint-plugin-import\": \"^2.18.0\",\n        \"eslint-plugin-jsx-a11y\": \"^6.2.3\",\n        \"eslint-plugin-react\": \"^7.14.2\",\n        \"express\": \"^4.17.1\",\n        \"express-group-routes\": \"^1.1.0\",\n        \"express-pino-logger\": \"^4.0.0\",\n        \"express-session\": \"^1.16.2\",\n        \"express-validator\": \"^6.15.0\",\n        \"fast-xml-parser\": \"^3.12.20\",\n        \"fastest-validator\": \"^0.6.17\",\n        \"file-type\": \"^12.3.0\",\n        \"gulp-sourcemaps\": \"^2.6.5\",\n        \"http-status-codes\": \"^1.3.2\",\n        \"ioredis\": \"^4.14.1\",\n        \"json2csv\": \"^5.0.3\",\n        \"json2xls\": \"^0.1.2\",\n        \"jsonwebtoken\": \"^8.5.1\",\n        \"lodash.isequal\": \"^4.5.0\",\n        \"lodash.merge\": \"^4.6.2\",\n        \"midtrans-client\": \"^1.0.3\",\n        \"module-alias\": \"^2.2.1\",\n        \"moment\": \"^2.24.0\",\n        \"multer\": \"^1.4.2\",\n        \"mysql\": \"^2.17.1\",\n        \"newrelic\": \"^8.6.0\",\n        \"otplib\": \"^11.0.1\",\n        \"pino\": \"^5.13.3\",\n        \"pm2\": \"^3.5.1\",\n        \"promise-mysql\": \"^4.1.0\",\n        \"pug\": \"^2.0.4\",\n        \"read-chunk\": \"^3.2.0\",\n        \"redis\": \"^2.8.0\",\n        \"sendmail\": \"^1.6.1\",\n        \"snakecase-keys\": \"^3.1.0\",\n        \"uuid\": \"^3.3.3\",\n        \"wkhtmltopdf\": \"^0.3.4\"\n    },\n    \"devDependencies\": {\n        \"@babel/core\": \"^7.6.0\",\n        \"@babel/plugin-syntax-nullish-coalescing-operator\": \"^7.8.3\",\n        \"@babel/polyfill\": \"^7.6.0\",\n        \"@babel/preset-env\": \"^7.6.0\",\n        \"assert-throws-async\": \"^3.0.0\",\n        \"chai\": \"^4.2.0\",\n        \"chai-http\": \"^4.3.0\",\n        \"gulp\": \"^4.0.2\",\n        \"gulp-babel\": \"^8.0.0\",\n        \"gulp-concat\": \"^2.6.1\",\n        \"gulp-csso\": \"^3.0.1\",\n        \"gulp-less\": \"^4.0.1\",\n        \"gulp-uglify\": \"^3.0.2\",\n        \"mocha\": \"^6.2.0\",\n        \"mock-req-res\": \"^1.1.1\",\n        \"mysql2\": \"^1.7.0\",\n        \"node-html-parser\": \"^1.1.16\",\n        \"nodemon\": \"^1.19.2\",\n        \"nyc\": \"^14.1.1\",\n        \"sequelize\": \"^5.19.0\",\n        \"sequelize-cli\": \"^5.5.1\",\n        \"sinon\": \"^7.4.2\"\n    },\n    \"_moduleAliases\": {\n        \"@root\": \".\",\n        \"@config\": \"config\",\n        \"@common\": \"modules/common\",\n        \"@dashboard-module\": \"modules/dashboard\",\n        \"@setting-module\": \"modules/setting\",\n        \"@delivery-setting-module\": \"modules/delivery-setting\",\n        \"@admin-setting-module\": \"modules/admin-setting\",\n        \"@login-module\": \"modules/login\",\n        \"@promo-module\": \"modules/promo\",\n        \"@promo-delivery-module\": \"modules/promo-delivery\",\n        \"@prescription-module\": \"modules/prescription\",\n        \"@monitor-ppd-module\": \"modules/monitor-ppd\",\n        \"@tag-module\": \"modules/tag\",\n        \"@upload-module\": \"modules/upload\",\n        \"@doctor-module\": \"modules/doctor\",\n        \"@referral-module\": \"modules/referral\",\n        \"@clinic-module\": \"modules/clinic\",\n        \"@assistant-module\": \"modules/assistant\",\n        \"@packaging-detail-module\": \"modules/packaging-detail\",\n        \"@order-module\": \"modules/order\",\n        \"@warehouse-group-module\": \"modules/warehouse-group\",\n        \"@partner-module\": \"modules/partner\",\n        \"@insurance-module\": \"modules/insurance\",\n        \"@warehouse-module\": \"modules/warehouse\",\n        \"@banner-module\": \"modules/banner\",\n        \"@corporate-module\": \"modules/corporate\",\n        \"@product-shop-module\": \"modules/product-shop\",\n        \"@product-module\": \"modules/product\",\n        \"@lib-logger\": \"lib/logger\",\n        \"@lib-error\": \"lib/errors\",\n        \"@middleware\": \"middleware\",\n        \"@report\": \"public/reports\",\n        \"@otc-monitor-ppd\": \"modules/monitor-ppd-otc\",\n        \"@customer-service-module\": \"modules/customer-service\",\n        \"@patient-module\": \"modules/patient\",\n        \"@formularium-module\": \"modules/formularium\",\n        \"@medrep-module\": \"modules/medrep\",\n        \"@patrep-module\": \"modules/patrep\",\n        \"@manufacture-module\": \"modules/manufacture\",\n        \"@customer-module\": \"modules/customer\"\n    },\n    \"nyc\": {\n        \"check-coverage\": true,\n        \"exclude\": \"modules/common/**/*.js\",\n        \"branches\": 95,\n        \"lines\": 98,\n        \"functions\": 98,\n        \"statements\": 98\n    }\n}","file":"package.json"}
[TRACE 09:57:00.657] warpgate::plugin:run  Called plugin function parse_version_file  plugin="npm" output={}
[TRACE 09:57:00.658] proto_core::tool:run  Attempting to detect a version from directory  tool="npm" dir="/Users/ImBIOS/itmi-id"
[TRACE 09:57:00.658] proto_core::tool:run  Attempting to detect a version from directory  tool="npm" dir="/Users/ImBIOS"
[DEBUG 09:57:00.658] proto_core::version_detector:run  Detected version from .prototools file  tool="npm" version="10.2.3" file="/Users/ImBIOS/.proto/.prototools"
[DEBUG 09:57:00.658] proto_core::tool:run  Resolving a semantic version or alias  tool="npm" initial_version="10.2.3"
[DEBUG 09:57:00.658] proto_core::tool:run  Resolved to 10.2.3 (without validation)  tool="npm" version="10.2.3"
[DEBUG 09:57:00.658] proto_core::tool:run  Checking if tool is installed  tool="npm" install_dir="/Users/ImBIOS/.proto/tools/npm/10.2.3"
[DEBUG 09:57:00.658] proto_core::tool:run  Tool has already been installed, locating binaries and shims  tool="npm" install_dir="/Users/ImBIOS/.proto/tools/npm/10.2.3"
[DEBUG 09:57:00.658] proto_core::tool:run  Locating executable for tool  tool="npm"
[TRACE 09:57:00.658] warpgate::plugin:run  Calling plugin function locate_executables  plugin="npm" input={"context":{"proto_version":"0.27.0","tool_dir":{"path":"/proto/tools/npm/10.2.3","virtual_prefix":"/proto","real_prefix":"/Users/ImBIOS/.proto"},"version":"10.2.3"}}
[TRACE 09:57:00.658] warpgate::plugin:run  Called plugin function locate_executables  plugin="npm" output={"globals_lookup_dirs":["$PROTO_HOME/tools/node/globals/bin"],"primary":{"exe_path":"bin/npm-cli.js","no_bin":true,"parent_exe_name":"node"},"secondary":{"node-gyp":{"exe_path":"node_modules/node-gyp/bin/node-gyp.js","no_bin":true,"parent_exe_name":"node"},"npx":{"exe_path":"bin/npx-cli.js","no_bin":true,"parent_exe_name":"node"}}}
[DEBUG 09:57:00.658] proto_core::tool:run  Found an executable  tool="npm" exe_path="/Users/ImBIOS/.proto/tools/npm/10.2.3/bin/npm-cli.js"
[TRACE 09:57:00.658] starbase_utils::fs:run  Reading bytes of file  file="/Users/ImBIOS/.proto/tools/proto/0.27.1/proto-shim"
[DEBUG 09:57:00.658] proto_core::tool:run  Creating shim  tool="npm" shim="/Users/ImBIOS/.proto/shims/npm" shim_version=13
[DEBUG 09:57:00.658] proto_core::tool:run  Creating shim  tool="npm" shim="/Users/ImBIOS/.proto/shims/node-gyp" shim_version=13
[DEBUG 09:57:00.658] proto_core::tool:run  Creating shim  tool="npm" shim="/Users/ImBIOS/.proto/shims/npx" shim_version=13
[TRACE 09:57:00.658] starbase_utils::fs:run  Opening file  file="/Users/ImBIOS/.proto/shims/registry.json"
[TRACE 09:57:00.658] starbase_utils::fs_lock:run  Locking file  file="/Users/ImBIOS/.proto/shims/registry.json"
[TRACE 09:57:00.658] starbase_utils::fs_lock:run  Unlocking file  file="/Users/ImBIOS/.proto/shims/registry.json"
[TRACE 09:57:00.658] warpgate::plugin:run  Calling plugin function pre_run  plugin="npm" input={"context":{"proto_version":"0.27.0","tool_dir":{"path":"/proto/tools/npm/10.2.3","virtual_prefix":"/proto","real_prefix":"/Users/ImBIOS/.proto"},"version":"10.2.3"},"passthrough_args":["run","watch:js"]}
[TRACE 09:57:00.658] warpgate::plugin:run  Called plugin function pre_run  plugin="npm" output=
[DEBUG 09:57:00.658] proto::commands::run:run  Running npm  bin="node" args=["/Users/ImBIOS/.proto/tools/npm/10.2.3/bin/npm-cli.js", "run", "watch:js"] pid=57679
[DEBUG 2024-01-08 09:57:00.665] proto  Running proto v0.27.0  bin="/Users/ImBIOS/.proto/tools/proto/0.27.1/proto" args=["run", "node", "--", "/Users/ImBIOS/.proto/tools/npm/10.2.3/bin/npm-cli.js", "run", "watch:js"] shim="node" shim_bin="/Users/ImBIOS/.proto/shims/node" pid=57679
[TRACE 09:57:00.666] starbase::app  Running startup phase with 3 systems 
[DEBUG 09:57:00.666] proto_core::proto:detect_proto_env  Creating proto environment, detecting store  store="/Users/ImBIOS/.proto"
[TRACE 09:57:00.666] starbase::app  Running analyze phase with 3 systems 
[TRACE 09:57:00.666] proto_core::proto_config:load_proto_configs  Traversing upwards and loading .prototools files 
[DEBUG 09:57:00.667] proto_core::proto_config:load_proto_configs  Loading .prototools  file="/Users/ImBIOS/.proto/.prototools"
[TRACE 09:57:00.667] starbase_utils::fs:load_proto_configs  Opening file  file="/Users/ImBIOS/.proto/.prototools"
[TRACE 09:57:00.667] starbase_utils::fs_lock:load_proto_configs  Locking file  file="/Users/ImBIOS/.proto/.prototools"
[TRACE 09:57:00.667] starbase_utils::fs_lock:load_proto_configs  Unlocking file  file="/Users/ImBIOS/.proto/.prototools"
[TRACE 09:57:00.667] schematic::config::loader:load_proto_configs  Loading partial configuration  config="ProtoConfig"
[TRACE 09:57:00.667] schematic::config::loader:load_proto_configs  Creating layer from source  config="ProtoConfig" source="<code>"
[TRACE 09:57:00.667] schematic::config::loader:load_proto_configs  Merging partial layers into a final result  config="ProtoConfig"
[DEBUG 09:57:00.667] proto_core::proto_config:load_proto_configs  Merging loaded configs 
[DEBUG 09:57:00.667] proto_core::proto_config:load_proto_configs  Merged 1 configs 
[TRACE 09:57:00.667] starbase::app  Running execute phase with 2 systems 
[DEBUG 09:57:00.667] proto_core::tool_loader:run  Finding a configured plugin  tool="node"
[DEBUG 09:57:00.667] proto_core::tool_loader:run  Using a built-in plugin  plugin="source:https://github.com/moonrepo/node-plugin/releases/download/v0.7.0/node_plugin.wasm"
[TRACE 09:57:00.667] warpgate::loader:run  Creating plugin loader  cache_dir="/Users/ImBIOS/.proto/plugins"
[TRACE 09:57:00.667] warpgate::loader:run  Loading plugin node  plugin="node"
[TRACE 09:57:00.667] starbase_utils::fs:run  Reading file metadata  file="/Users/ImBIOS/.proto/plugins/node-efd968666f71a17d40572eab6f9f2c92fe21db876942b6f22423843c831c2e47.wasm"
[TRACE 09:57:00.667] warpgate::loader:run  Plugin already downloaded and cached  plugin="node" path="/Users/ImBIOS/.proto/plugins/node-efd968666f71a17d40572eab6f9f2c92fe21db876942b6f22423843c831c2e47.wasm"
[DEBUG 09:57:00.667] proto_core::tool_loader:run  Loading WASM plugin  source="/Users/ImBIOS/.proto/plugins/node-efd968666f71a17d40572eab6f9f2c92fe21db876942b6f22423843c831c2e47.wasm"
[TRACE 09:57:00.667] proto_core::tool_loader:run  Storing tool identifier  id="node"
[TRACE 09:57:00.667] proto_core::tool_loader:run  Storing proto environment  env={"arch":"arm64","os":"macos","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"/Users/ImBIOS"},"proto_dir":{"path":"/proto/","virtual_prefix":"/proto","real_prefix":"/Users/ImBIOS/.proto"}}
[DEBUG 09:57:00.667] proto_core::tool:run  Creating tool node and instantiating plugin 
[DEBUG 09:57:00.667] proto_core::tool_manifest:run  Loading manifest.json  file="/Users/ImBIOS/.proto/tools/node/manifest.json"
[TRACE 09:57:00.667] starbase_utils::fs:run  Opening file  file="/Users/ImBIOS/.proto/tools/node/manifest.json"
[TRACE 09:57:00.668] starbase_utils::fs_lock:run  Locking file  file="/Users/ImBIOS/.proto/tools/node/manifest.json"
[TRACE 09:57:00.668] starbase_utils::fs_lock:run  Unlocking file  file="/Users/ImBIOS/.proto/tools/node/manifest.json"
[DEBUG 09:57:00.690] proto_core::tool:run  Created tool node and its WASM runtime 
[TRACE 09:57:00.691] warpgate::plugin:run  Calling plugin function register_tool  plugin="node" input={"id":"node"}
[TRACE 09:57:00.691] warpgate::plugin:run  Called plugin function register_tool  plugin="node" output={"inventory":{},"name":"Node.js","plugin_version":"0.7.0","type":"Language"}
[TRACE 09:57:00.691] proto_core::version_detector:run  Attempting to find version from .prototools files  tool="node"
[TRACE 09:57:00.691] warpgate::plugin:run  Calling plugin function detect_version_files  plugin="node" input={}
[TRACE 09:57:00.691] warpgate::plugin:run  Called plugin function detect_version_files  plugin="node" output={"files":[".nvmrc",".node-version","package.json"],"ignore":["node_modules"]}
[TRACE 09:57:00.691] proto_core::tool:run  Attempting to detect a version from directory  tool="node" dir="/Users/ImBIOS/itmi-id/itmi-admin"
[TRACE 09:57:00.691] starbase_utils::fs:run  Reading file  file="/Users/ImBIOS/itmi-id/itmi-admin/.node-version"
[TRACE 09:57:00.691] warpgate::plugin:run  Calling plugin function parse_version_file  plugin="node" input={"content":"14.19.1","file":".node-version"}
[TRACE 09:57:00.692] warpgate::plugin:run  Called plugin function parse_version_file  plugin="node" output={"version":"14.19.1"}
[DEBUG 09:57:00.692] proto_core::tool:run  Detected a version  tool="node" file="/Users/ImBIOS/itmi-id/itmi-admin/.node-version" version="14.19.1"
[DEBUG 09:57:00.692] proto_core::version_detector:run  Detected version from tool's ecosystem  tool="node" version="14.19.1" file="/Users/ImBIOS/itmi-id/itmi-admin/.node-version"
[DEBUG 09:57:00.692] proto_core::tool:run  Resolving a semantic version or alias  tool="node" initial_version="14.19.1"
[DEBUG 09:57:00.692] proto_core::tool:run  Resolved to 14.19.1 (without validation)  tool="node" version="14.19.1"
[DEBUG 09:57:00.692] proto_core::tool:run  Checking if tool is installed  tool="node" install_dir="/Users/ImBIOS/.proto/tools/node/14.19.1"
[DEBUG 09:57:00.692] proto_core::tool:run  Tool has already been installed, locating binaries and shims  tool="node" install_dir="/Users/ImBIOS/.proto/tools/node/14.19.1"
[DEBUG 09:57:00.692] proto_core::tool:run  Locating executable for tool  tool="node"
[TRACE 09:57:00.692] warpgate::plugin:run  Calling plugin function locate_executables  plugin="node" input={"context":{"proto_version":"0.27.0","tool_dir":{"path":"/proto/tools/node/14.19.1","virtual_prefix":"/proto","real_prefix":"/Users/ImBIOS/.proto"},"version":"14.19.1"}}
[TRACE 09:57:00.693] warpgate::plugin:run  Called plugin function locate_executables  plugin="node" output={"globals_lookup_dirs":["$PROTO_HOME/tools/node/globals/bin"],"primary":{"exe_path":"bin/node"}}
[DEBUG 09:57:00.693] proto_core::tool:run  Found an executable  tool="node" exe_path="/Users/ImBIOS/.proto/tools/node/14.19.1/bin/node"
[TRACE 09:57:00.693] starbase_utils::fs:run  Reading bytes of file  file="/Users/ImBIOS/.proto/tools/proto/0.27.0/proto-shim"
[DEBUG 09:57:00.693] proto_core::tool:run  Creating shim  tool="node" shim="/Users/ImBIOS/.proto/shims/node" shim_version=13
[TRACE 09:57:00.693] starbase_utils::fs:run  Opening file  file="/Users/ImBIOS/.proto/shims/registry.json"
[TRACE 09:57:00.693] starbase_utils::fs_lock:run  Locking file  file="/Users/ImBIOS/.proto/shims/registry.json"
[TRACE 09:57:00.693] starbase_utils::fs_lock:run  Unlocking file  file="/Users/ImBIOS/.proto/shims/registry.json"
[DEBUG 09:57:00.693] proto::commands::run:run  Running Node.js  bin="/Users/ImBIOS/.proto/tools/node/14.19.1/bin/node" args=["/Users/ImBIOS/.proto/tools/npm/10.2.3/bin/npm-cli.js", "run", "watch:js"] pid=57679
ERROR: npm v10.2.3 is known not to run on Node.js v14.19.1.  This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.

Operating system?

MacOS

Architecture?

arm64

ImBIOS commented 8 months ago

Wait... is it a feature or is it a bug?

milesj commented 8 months ago

@ImBIOS When you run npm it doesn't use the npm version associated with the current node version, it uses whatever npm version you have pinned or has been detected:

[DEBUG 09:57:00.658] proto_core::version_detector:run  Detected version from .prototools file  tool="npm" version="10.2.3" file="/Users/ImBIOS/.proto/.prototools"

In this case, it's using 10.2.3. This is technically working as intended, but I agree, a bit confusing. You can set this pinned version to bundled and it should work how you expect.

You can force an older version with PROTO_NPM_VERSION=x.x.x npm ... or use bundled with PROTO_NPM_VERSION=bundled npm ....

ImBIOS commented 8 months ago

It is a bad experience from a user standpoint. But, it's my responsibility too to set the global npm to a fixed version myself LOL.