Closed joelanman closed 2 years ago
via @36degrees :
Running software under Rosetta
I've tried running the kit on my M1 MacBook Air under Node 14.
Rosetta seemed to kick in automatically as I could see Node running with Intel architecture – it all 'just worked'. I've verified that 'Open using Rosetta' is not checked for the Terminal app.
I wasn't able to replicate a true 'blank slate' as I'd already got nvm
installed locally, but I followed the instructions in the kit docs and installed Node 14 using the installer (which worked just fine), and switched nvm to use the 'system' version of node which I think is pretty much the same.
➜ my-prototype nvm use system
Now using system version of node: v14.16.1 (npm v6.14.12)
➜ my-prototype node --version
v14.16.1
➜ my-prototype npm start
> govuk-prototype-kit@9.12.1 start /Users/oliverbyford/Code/my-prototype
> node start.js
[13:17:38] Using gulpfile ~/Code/my-prototype/gulpfile.js
[13:17:38] Starting 'default'...
[13:17:38] Starting 'generate-assets'...
[13:17:38] Starting 'clean'...
[13:17:38] Finished 'clean' after 11 ms
[13:17:38] Starting 'sass-extensions'...
[13:17:38] Finished 'sass-extensions' after 1.2 ms
[13:17:38] Starting 'sass'...
[13:17:38] Starting 'copy-assets'...
[13:17:38] Starting 'sass-documentation'...
[13:17:38] Starting 'copy-assets-documentation'...
[13:17:38] Starting 'sass-v6'...
[13:17:38] Starting 'copy-assets-v6'...
[13:17:38] Finished 'sass-v6' after 30 ms
[13:17:38] Finished 'copy-assets-v6' after 31 ms
[13:17:38] Finished 'copy-assets' after 57 ms
[13:17:38] Finished 'copy-assets-documentation' after 58 ms
[13:17:38] Finished 'sass-documentation' after 352 ms
[13:17:38] Finished 'sass' after 648 ms
[13:17:38] Finished 'generate-assets' after 661 ms
[13:17:38] Starting 'watch'...
[13:17:38] Starting 'server'...
[13:17:38] Starting 'watch-sass'...
[13:17:38] Starting 'watch-assets'...
[13:17:38] Starting 'watch-sass-v6'...
[13:17:38] Starting 'watch-assets-v6'...
[13:17:39] [nodemon] 2.0.7
[13:17:39] [nodemon] to restart at any time, enter `rs`
[13:17:39] [nodemon] watching path(s): .env **/*.js **/*.json
[13:17:39] [nodemon] watching extensions: js,mjs,json
[13:17:39] [nodemon] starting `node listen-on-port.js`
GOV.UK Prototype Kit v9.12.1
NOTICE: the kit is for building prototypes, do not use it for production services.
Listening on port 3000 url: http://localhost:3000
➜ my-prototype node -p 'process.arch'
x64
@frankieroberto what issues were you seeing with Node 14 that prompted you to use Node 15 instead?
I guess the other thing that I'd 'already done' is installed Rosetta 2. I think Apple prompts you to install it when it detects it's needed, but I don't know if that works for command line applications?
@36degrees interesting! I get a compile error when trying to run npm install
for the kit using node 14, even with rosetta installed.
How did you install node and nvm? When I run nvm use system
I get v12.16.2
, and no version of npm
available at all.
How did you install node and nvm? When I run
nvm use system
I getv12.16.2
, and no version ofnpm
available at all.
I installed it using the installer for 14.16.1 from https://nodejs.org/en/, which I think overwrote the v12 install that I guess comes with macOS?
@36degrees ah. I think I went straight to installing nvm
, and then using that to install different versions. Do you get the same error when using v14 as installed using nvm (which then installs node against the arm64
architecture I think)?
Weirdly, having gotten the kit working with node 15, it now also runs using node 14, although I do still get a whole bunch of sass compilation warnings when running npm install
.
Hopefully this will all get smoothed out over the coming year!
Nope, seems to work fine… (albeit tested with a slightly older version)
➜ my-prototype nvm use lts/fermium
Now using node v14.15.5 (npm v6.14.11)
➜ my-prototype rm -rf node_modules
➜ my-prototype npm install
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise@4.2.2: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
> fsevents@1.2.13 install /Users/oliverbyford/Code/my-prototype/node_modules/glob-watcher/node_modules/fsevents
> node install.js
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
> node-sass@4.14.1 install /Users/oliverbyford/Code/my-prototype/node_modules/node-sass
> node scripts/install.js
Cached binary found at /Users/oliverbyford/.npm/node-sass/4.14.1/darwin-x64-83_binding.node
> nodemon@2.0.7 postinstall /Users/oliverbyford/Code/my-prototype/node_modules/nodemon
> node bin/postinstall || exit 0
> node-sass@4.14.1 postinstall /Users/oliverbyford/Code/my-prototype/node_modules/node-sass
> node scripts/build.js
Binary found at /Users/oliverbyford/Code/my-prototype/node_modules/node-sass/vendor/darwin-x64-83/binding.node
Testing binary
Binary is fine
added 1426 packages from 792 contributors in 21.563s
66 packages are looking for funding
run `npm fund` for details
➜ my-prototype npm start
> govuk-prototype-kit@9.12.1 start /Users/oliverbyford/Code/my-prototype
> node start.js
[14:22:09] Using gulpfile ~/Code/my-prototype/gulpfile.js
[14:22:09] Starting 'default'...
[14:22:09] Starting 'generate-assets'...
[14:22:09] Starting 'clean'...
[14:22:09] Finished 'clean' after 11 ms
[14:22:09] Starting 'sass-extensions'...
[14:22:09] Finished 'sass-extensions' after 1.11 ms
[14:22:09] Starting 'sass'...
[14:22:09] Starting 'copy-assets'...
[14:22:09] Starting 'sass-documentation'...
[14:22:09] Starting 'copy-assets-documentation'...
[14:22:09] Starting 'sass-v6'...
[14:22:09] Starting 'copy-assets-v6'...
[14:22:09] Finished 'sass-v6' after 30 ms
[14:22:09] Finished 'copy-assets-v6' after 31 ms
[14:22:09] Finished 'copy-assets' after 58 ms
[14:22:09] Finished 'copy-assets-documentation' after 59 ms
[14:22:10] Finished 'sass-documentation' after 351 ms
[14:22:10] Finished 'sass' after 649 ms
[14:22:10] Finished 'generate-assets' after 663 ms
[14:22:10] Starting 'watch'...
[14:22:10] Starting 'server'...
[14:22:10] Starting 'watch-sass'...
[14:22:10] Starting 'watch-assets'...
[14:22:10] Starting 'watch-sass-v6'...
[14:22:10] Starting 'watch-assets-v6'...
[14:22:10] [nodemon] 2.0.7
[14:22:10] [nodemon] to restart at any time, enter `rs`
[14:22:10] [nodemon] watching path(s): .env **/*.js **/*.json
[14:22:10] [nodemon] watching extensions: js,mjs,json
[14:22:10] [nodemon] starting `node listen-on-port.js`
GOV.UK Prototype Kit v9.12.1
NOTICE: the kit is for building prototypes, do not use it for production services.
Listening on port 3000 url: http://localhost:3000
🤔
Trying to install latest 14.x through nvm at the min but it's still compiling… ⏱️
OK, testing with 14.6.1 under nvm I've now got it to throw warnings during npm install
, but it still seems to run quite happily!
We have released v12.0.2 which works on M1 Macs