e2openplugin-OpenWebif icon indicating copy to clipboard operation
e2openplugin-OpenWebif copied to clipboard

Node.js minify css on MacOSX

Open jbleyel opened this issue 4 years ago • 19 comments

This command do not work on MacOSX. (cd ./sourcefiles/modern/ && npm run build-css)

Error: ENOTDIR: not a directory, open 'XXX/e2openplugin-OpenWebif/sourcefiles/modern/_utils/mincss.js/package.json'

jbleyel avatar Feb 13 '21 15:02 jbleyel

@wedebe : please take over.

jbleyel avatar Feb 13 '21 16:02 jbleyel

I can make the min files by calling. cleancss -o ./css/style.min.css ./css/style.css

This command have an issue on mac.

npx ./_utils/mincss.js -o '../../plugin/public/modern/' './css/**/*.css'

verbose stack Error: ENOTDIR: not a directory, open '.../e2openplugin-OpenWebif/sourcefiles/modern/_utils/mincss.js/package.json'

jbleyel avatar Feb 20 '21 10:02 jbleyel

@jbleyel , which folder are you in when you run that command? (cd ./sourcefiles/modern/ && npm run build-css)

wedebe avatar Feb 20 '21 19:02 wedebe

I goto modern and call :

npm run build-css or

npx ./_utils/mincss.js -o '../../plugin/public/modern/' './css/**/*.css'

same result

jbleyel avatar Feb 20 '21 19:02 jbleyel

it works if i call this :

cleancss -o ./css/style.min.css ./css/style.css

jbleyel avatar Feb 20 '21 19:02 jbleyel

It's not that important. I think you should check the other css issues first.

jbleyel avatar Feb 20 '21 19:02 jbleyel

openwebif$ (cd ./sourcefiles/modern/ && npm run build-css)

[email protected] build-css ~/Development/wedebe/enigma2/e2openplugin/openwebif/sourcefiles/modern npx ./_utils/mincss.js -o '../../plugin/public/modern/' './css/**/*.css'

where pwd: ~/Development/wedebe/enigma2/e2openplugin/openwebif/

(this works for me on MacOS)

Could you do an ls on the sourcefiles dir, please?

wedebe avatar Feb 20 '21 19:02 wedebe

/sourcefiles css jquery-ui modern themes fontello_config.json js scss

./modern

_utils dist js package.json bqe-app.js entry-app.js node_modules plugins css glob-uglifyjs.config.json package-lock.json

jbleyel avatar Feb 20 '21 19:02 jbleyel

Hmm, the dist folder isn't needed in ./sourcefiles/modern, but that's not the issue here.

does npm run build-entry work for you from ./sourcefiles/modern/?

Could you run nvm ls and post the result to see which node version's being used for the call, please? (for reference, I've got v10.23.0 and I believe v8.11.4 worked for me, whereas v6.14.2 did not)

wedebe avatar Feb 21 '21 01:02 wedebe

[email protected] build-entry npx parcel build ./entry-app.js --out-dir ../../plugin/public/modern/js/

✨ Built in 4.50s.

../../plugin/public/modern/js/entry-app.js.map 321 KB 45ms ../../plugin/public/modern/js/entry-app.js 130.32 KB 4.01s npm notice npm notice New patch version of npm available! 7.5.1 -> 7.5.4 npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.5.4 npm notice Run npm install -g [email protected] to update! npm notice

jbleyel avatar Feb 21 '21 11:02 jbleyel

I have installed node from this page : https://nodejs.org/en/download/

There is no nvm. zsh: command not found: nvm

jbleyel avatar Feb 21 '21 11:02 jbleyel

I have removed the node_modules and called npm install.

Same result:

npm run build-css

[email protected] build-css npx ./_utils/mincss.js -o '../../plugin/public/modern/' './css/**/*.css'

npm ERR! code ENOTDIR npm ERR! syscall open npm ERR! path /../e2openplugin-OpenWebif/sourcefiles/modern/_utils/mincss.js/package.json npm ERR! errno -20 npm ERR! ENOTDIR: not a directory, open '/../e2openplugin-OpenWebif/sourcefiles/modern/_utils/mincss.js/package.json'

npm ERR! A complete log of this run can be found in: npm ERR! ...npm/_logs/2021-02-21T11_28_08_428Z-debug.log npm ERR! code 236 npm ERR! path /../e2openplugin-OpenWebif/sourcefiles/modern npm ERR! command failed npm ERR! command sh -c npx ./_utils/mincss.js -o '../../plugin/public/modern/' './css/**/*.css'

npm ERR! A complete log of this run can be found in: npm ERR! /../.npm/_logs/2021-02-21T11_28_08_476Z-debug.log

DEBUG LOG:

0 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build-css' ] 1 info using [email protected] 2 info using [email protected] 3 timing config:load:defaults Completed in 2ms 4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms 5 timing config:load:builtin Completed in 1ms 6 timing config:load:cli Completed in 1ms 7 timing config:load:env Completed in 0ms 8 timing config:load:file:/../e2openplugin-OpenWebif/sourcefiles/modern/.npmrc Completed in 0ms 9 timing config:load:project Completed in 1ms 10 timing config:load:file:/../.npmrc Completed in 0ms 11 timing config:load:user Completed in 0ms 12 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms 13 timing config:load:global Completed in 0ms 14 timing config:load:cafile Completed in 0ms 15 timing config:load:validate Completed in 0ms 16 timing config:load:setUserAgent Completed in 0ms 17 timing config:load:setEnvs Completed in 1ms 18 timing config:load Completed in 7ms 19 verbose npm-session ce2ab85c0412261e 20 timing npm:load Completed in 43ms 21 timing command:run-script Completed in 510ms 22 verbose stack Error: command failed 22 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27) 22 verbose stack at ChildProcess.emit (node:events:378:20) 22 verbose stack at maybeClose (node:internal/child_process:1067:16) 22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) 23 verbose pkgid [email protected] 24 verbose cwd /../e2openplugin-OpenWebif/sourcefiles/modern 25 verbose Darwin 20.3.0 26 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-css" 27 verbose node v15.9.0 28 verbose npm v7.5.3 29 error code 236 30 error path /../e2openplugin-OpenWebif/sourcefiles/modern 31 error command failed 32 error command sh -c npx ./_utils/mincss.js -o '../../plugin/public/modern/' './css/**/*.css' 33 verbose exit 236

jbleyel avatar Feb 21 '21 11:02 jbleyel

FIXED !! I have removed /usr/local/lib/node_modules and reinstall node.js Then npm install in modern folder.

jbleyel avatar Feb 21 '21 11:02 jbleyel

Great :)

Should the readme be updated to clarify this?

wedebe avatar Feb 22 '21 00:02 wedebe

No.

jbleyel avatar Feb 22 '21 19:02 jbleyel

0 verbose cli [
0 verbose cli   '/usr/local/bin/node',
0 verbose cli   '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli   'exec',
0 verbose cli   '--',
0 verbose cli   './_utils/mincss.js',
0 verbose cli   '-o',
0 verbose cli   '../plugin/public/',
0 verbose cli   './modern/css/**/*.css'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 0ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/.../e2openplugin-OpenWebif/sourcefiles/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/...l/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 6ms
19 timing npm:load:configload Completed in 6ms
20 timing npm:load:setTitle Completed in 16ms
21 timing npm:load:setupLog Completed in 1ms
22 timing npm:load:cleanupLog Completed in 2ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 1ms
25 timing npm:load Completed in 27ms
26 timing config:load:flatten Completed in 2ms
27 timing command:exec Completed in 5ms
28 verbose stack Error: ENOTDIR: not a directory, open '/.../e2openplugin-OpenWebif/sourcefiles/_utils/mincss.js/package.json'
29 verbose cwd /.../e2openplugin-OpenWebif/sourcefiles
30 verbose Darwin 20.3.0
31 verbose argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "./_utils/mincss.js" "-o" "../plugin/public/" "./modern/css/**/*.css"
32 verbose node v16.3.0
33 verbose npm  v7.15.1
34 error code ENOTDIR
35 error syscall open
36 error path /.../e2openplugin-OpenWebif/sourcefiles/_utils/mincss.js/package.json
37 error errno -20
38 error ENOTDIR: not a directory, open '/.../e2openplugin-OpenWebif/sourcefiles/_utils/mincss.js/package.json'
39 verbose exit -20

jbleyel avatar Jun 19 '21 06:06 jbleyel

UPDATE !!

Install node 14.17.1 LTS from here https://nodejs.org/en/

-> Success

Install node 16.3.0 from here https://nodejs.org/en/

-> Failed

!! Thats a problem because i need node 16.x for other things and i cannot have 14 and 16 on the same machine.

jbleyel avatar Jun 19 '21 07:06 jbleyel

UPDATE !!

Install node 14.17.1 LTS from here https://nodejs.org/en/

-> Success

Install node 16.3.0 from here https://nodejs.org/en/

-> Failed

!! Thats a problem because i need node 16.x for other things and i cannot have 14 and 16 on the same machine.

nvm (Node Version Manager) allows several versions on the same machine, selectable by specifying nvm use xx https://www.joseverissimo.com/blog/install-nvm-on-zsh-macos-catalina

For example, I've got...

nvm ls
        v6.14.2
        v8.11.4
        v10.3.0
       v10.23.0
->     v12.22.1
        v15.1.0
default -> 10 (-> v10.23.0)
node -> stable (-> v15.1.0) (default)
stable -> 15.1 (-> v15.1.0) (default)
iojs -> N/A (default)
lts/* -> lts/fermium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.1
lts/fermium -> v14.17.1 (-> N/A)

wedebe avatar Jun 20 '21 22:06 wedebe

Either way, I'm gonna investigate alternative solutions when I have some time.

wedebe avatar Jun 20 '21 22:06 wedebe