django-tailwind, can't start dev server - django

I've done everything according to the django-tailwind docs, but when I want to start the dev server I get the following error:
> theme#3.1.1 start /home/amir/projects/planning-project/src/theme/static_src
> npm run dev
> theme#3.1.1 dev /home/amir/projects/planning-project/src/theme/static_src
> cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w
/home/amir/projects/planning-project/src/theme/static_src/node_modules/tailwindcss/lib/cli.js:300
throw err;
^
TypeError: Object.fromEntries is not a function
at args (/home/amir/projects/planning-project/src/theme/static_src/node_modules/tailwindcss/lib/cli.js:243:47)
at Object.<anonymous> (/home/amir/projects/planning-project/src/theme/static_src/node_modules/tailwindcss/lib/cli.js:302:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! theme#3.1.1 dev: `cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the theme#3.1.1 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/amir/.npm/_logs/2022-02-11T09_27_46_003Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! theme#3.1.1 start: `npm run dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the theme#3.1.1 start script.
I have tried going into "theme/static_src/src" directory and running npm run build-postcss, based on an answer on GitHub issue tracker, but then I get :
npm ERR! missing script: build-postcss

Turns out since I installed node via the standard servers it was an old version. You need to install a newer node version to solve this problem.

Related

How to skip __mock__ folder while running strapi

I am working on writing unit tests for API written in strapi. So I create a mocks folder to mock firebase API call.
This code works well when I am running the test with jest but when I run the application with npm run develop it gives me below error
[2020-06-02T12:14:58.977Z] debug ⛔️ Server wasn't able to start properly.
[2020-06-02T12:14:58.978Z] error ReferenceError: jest is not defined
at Object.<anonymous> (/home/backend/Documents/workspace/proj/config/functions/__mocks__/firebase.js:1:23)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at module.exports.filePath (/home/backend/Documents/workspace/proj/node_modules/strapi/lib/load/require-file-parse.js:12:10)
at loadFiles (/home/backend/Documents/workspace/proj/node_modules/strapi/lib/load/load-files.js:35:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! proj#0.1.0 develop: `strapi develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the proj#0.1.0 develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/backend/.npm/_logs/2020-06-02T12_14_58_985Z-debug.log
➜ proj git:(test) ✗
Is there any way to fix this issue ?

Elastic Beanstalk EBS NPM Bower install is failing

Having an issue with my EBS deployment. Getting this output everytime it tries to deploy the build.
Application deployment failed at 2018-07-02T02:46:14Z with exit status 1 and error: command npm_install_bower in .ebextensions/bower.config failed.
npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower
npm ERR! Error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! at SecurePair.<anonymous> (tls.js:1430:32)
npm ERR! at SecurePair.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:1029:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:521:13)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:341:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:418:25)
npm ERR! at doWrite (_stream_writable.js:226:10)
npm ERR! at writeOrBuffer (_stream_writable.js:216:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR! at write (_stream_readable.js:602:24)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 4.14.47-56.37.amzn1.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /opt/elasticbeanstalk/eb_infra
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /opt/elasticbeanstalk/eb_infra/npm-debug.log
npm ERR! not ok code 0.
bower.config file is:
commands:
get_sudo:
command: echo Defaults:root \!requiretty >> /etc/sudoers
npm_install:
command: sudo yum -y --enablerepo=epel install nodejs npm
npm_install_bower:
command: sudo npm install -g bower
container_commands:
01_bower_install:
command: "export PATH=$PATH; $NODE_HOME/bin/node ./node_modules/bowe/bin/bower -V install --allow-root -F > /tmp/01_bower_install.log"
Tried it without 01_bower_install part as well but same result. Fails to deploy. Was working fine until 2 days ago on the instance and now showing:
Forbidden You don't have permission to access / on this server.
..on the URL.
Help greatly appreciated!
I spent few hours today on the same issue, bower would not be installed by npm and would not run. Eventually got it work as follows:
1) remove "bower" from package.json
2) here is my ebextension file that managed to install bower and run it, by making it a global command:
container_commands:
install_bower:
command: "export PATH=$PATH:$NODE_HOME/bin; npm install bower -g; bower install --allow-root"
Cheers,
Z.

Laravel 5.5 API Authentication (Passport) - cross-env: not found error, when i run npm run dev

I have tried to implement laravel passport authentication in my project, but it's not working. Initially, i have installed laravel5.5 with other configuration and file permissions all the stuff.
To implement passport authentication I have followed laravel documentation Document Url
Following steps, I have done,
composer require laravel/passport
php artisan migrate
php artisan passport:install
I have added this line App\User
use Laravel\Passport\HasApiTokens;
use HasApiTokens, Notifiable;
Routes Added in AuthServiceProvider file inside the boot function
Passport::routes();
Inside the config/auth.php file, I have changed API driver as passport
php artisan vendor:publish --tag=passport-components
Inside this file resources/assets/js/app.js
Vue.component(
'passport-clients',
require('./components/passport/Clients.vue')
);
Vue.component(
'passport-authorized-clients',
require('./components/passport/AuthorizedClients.vue')
);
Vue.component(
'passport-personal-access-tokens',
require('./components/passport/PersonalAccessTokens.vue')
);
npm run dev
When running this command I'm getting an error
$ npm run dev
# dev /var/www/html/local/laravel5.5
npm run development
# development /var/www/html/local/laravel5.5
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
sh: 1: cross-env: not found
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/node" "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/npm" "run" "development"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! # development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the # development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/local/laravel5.5/npm-debug.log
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/node" "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/npm" "run" "dev"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! # dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/local/laravel5.5/npm-debug.log
You must run in cmd/terminal, from your project folder
npm install --save
and then
npm run dev

Installing Electron on Windows 10 (`node-gyp rebuild` error)

I've seen a lot of Stack posts and GitHub posts on this, but I've hit a dead end and I'm not sure where else to turn (apologies if duplicate).
I'm following a guide here to install Electron. On the command npm install --runtime=electron --target=1.4.15, I hit the common stack:
> msgpack#1.0.2 install D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\msgpack
> node-gyp rebuild
D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\msgpack>if not defined npm_config_n
ode_gyp (node "C:\Users\User Name\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp
\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 response downloading https://iojs.org/download/release/v1.4.15/iojs-v1.4.15.tar.gz
gyp ERR! stack at Request.<anonymous> (C:\Users\User Name\AppData\Roaming\npm\node_modules\npm\node_modules\node
-gyp\lib\install.js:210:14)
gyp ERR! stack at emitOne (events.js:101:20)
gyp ERR! stack at Request.emit (events.js:188:7)
gyp ERR! stack at Request.onRequestResponse (C:\Users\User Name\AppData\Roaming\npm\node_modules\npm\node_module
s\request\request.js:1074:10)
gyp ERR! stack at emitOne (events.js:96:13)
gyp ERR! stack at ClientRequest.emit (events.js:188:7)
gyp ERR! stack at HTTPParser.parserOnIncomingClient (_http_client.js:473:21)
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:362:20)
gyp ERR! stack at emitOne (events.js:96:13)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User Name\\AppData\\Roaming\\npm\\node_modules\\n
pm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\msgpack
gyp ERR! node -v v6.10.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN gnomics# No description
npm WARN gnomics# No repository field.
npm WARN gnomics# No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! msgpack#1.0.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the msgpack#1.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User Name\AppData\Roaming\npm-cache\_logs\2017-09-25T04_40_03_337Z-debug.log
The guide suggests building from the source by running npm install --global --production windows-build-tools, which runs successfully, but even after clearing the cache, the Electron install command still produces the same error.
I have Python2.7 in my PATH variable and PYTHON variable, as suggested by some Stack answers.
Funny enough, running npm config -g set msvs_version 2015 followed by npm i worked. Then running the Electron install command seemed to work, until I ran the test ./node_modules/.bin/electron, which produced:
D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\electron\index.js:9
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
^
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at Object.<anonymous> (D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\electron
\index.js:9:9)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\electron
\cli.js:3:16)
at Module._compile (module.js:570:32)
This is all being run on a x64 Windows 10 system. I've tried everything above on Windows PowerShell (as admin and not as admin), on command prompt (as admin and not as admin), and on Git Bash, all with the same error messages.
Any help would be much appreciated! (If any additional info is needed, such as Microsoft Visual Studio, SDK, or other installs, please let me know which ones and I'll updated accordingly).
EDIT 1: Just of note, running everything as a single command, i.e. npm install --global --production --runtime=electron --target=1.4.15 --build-from-source windows-build-tools also doesn't work (well the install completes without error, but Electron still says that it failed to install correctly).
UPDATE 1: Okay, so I deleted everything and cleared the cache and then I ran npm config -g set msvs_version 2015, followed by npm i, and then npm install --runtime=electron --target=1.4.15. Next I ran ./node_modules/.bin/electron which worked. But then, launching the actual project created a new Electron error... So I don't think I "solved" anything really. The new error was:
D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\bindings\bindings.js:83 Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\\?\D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\zmq\build\Release\zmq.node
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at bindings (D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\bindings\bindings.js:76:44)
at Object.<anonymous> (D:\Research Documents\Fall 2017 - Work\Lab Work\sample_app\node_modules\zmq\lib\index.js:6:30)

parse server elastic beanstalk 502 error

I have gotten my parse server to upload to elastic beanstalk, but when I click the URL to my application on aws eb I get a 502 error every time. I have PARSE_SERVER_APPLICATION_ID,database uri, master key, and server url "serverurl"/parse.yet I am still getting this error. please help.
> parse-server#2.2.15 start /var/app/current
> node ./bin/parse-server
module.js:327
throw err;
^
Error: Cannot find module '../lib/cli/parse-server'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/var/app/current/bin/parse-server:3:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
npm ERR! Linux 4.4.14-24.50.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/npm" "start"
npm ERR! node v4.4.6
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! parse-server#2.2.15 start: `node ./bin/parse-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the parse-server#2.2.15 start script 'node ./bin/parse-server'.
npm ERR! This is most likely a problem with the parse-server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/parse-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs parse-server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls parse-server
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/app/current/npm-debug.log