How to run a postinstall script after - yarnpkg-v3

I am migrating from yarn version 1.22 to yarn v3.2.3. I have a prepare script that was running automatically after install.
My prepare script generates some files (FIY Nuxt 3 generated files).
It does not run anymore on yarn 3, and how can I get the same effect? I don't find it on https://yarnpkg.com/advanced/lifecycle-scripts.
Maybe I am misreading.

I have finally found a solution:
Install the Yarn plugin after install: yarn plugin import https://raw.githubusercontent.com/mhassan1/yarn-plugin-after-install/v0.3.1/bundles/#yarnpkg/plugin-after-install.js.
See the command in the README to get the latest version.
In a .yarnrc.yml at the root of your project, add your command: afterInstall: <your-command>

Related

Starting existing strapi project locally

How can I start existing strapi project locally?
I want to be able to run strapi dashboard locally.
I tried with npm install, npm run develop but I'm getting - npm ERR! missing script: develop.
Any help would be nice!
Tnx
Ok. So incase somebody else is still wondering how to solve this.
$ cd to your project
$ run the npm install or yarn to install the node_modules, and run the npm run develop or yarn develop.

Hexo init fails on Windows

I am trying to initialize a Hexo site on my Windows 10 PC. I have Node 9.9.0 installed as well as git 2.16.2.windows.1.
I have run npm install hexo-cli -g and it installs fine. I then go about the steps listed to create and initialize a site (hexo init test-site) and get the following errors.
I've tried a fresh install of node and git, running npm install a-sync-waterfall -g, and adding a file to node_modules called .a-sync-waterfall.DELETE; but hexo init still fails. Manually running npm install also gives me the same error.
Any ideas? Thanks.
Windows and NPM are not the most stable together. I've found Yarn to much more stable.
Try one of these two things:
Use Yarn
Delete node_modules folder, clear the NPM global cache, attempt a hexo init
del node_modules
npm cache clear --force
hexo init test-site

Electron cannot find module mysql

So i've been creating a desktop application using electron. The problem is that when I run my application using npm it doesn't show any error about a missing module but when i package it and run it this error shows
I'm sure that i've install mysql module using npm install -g mysql and npm install mysql in the project directory. It's all working fine when i run the unpacked version of the application
Assuming that you have installed mysql if not please install mysql npm install mysql --save-dev
Hi I also ran in same error I tried everything possible but nothing seems to work , after several hit and trial I was able to fix it and in the end realize that it was all happening because of
When I installed MySQL module I never saved it (--save-dev)
And electron-packager was not able to locate it when I pack it because was not mention in package.json
A solution might locate mysql folder in node_module folder and delete
then install it npm install mysql --save-dev
or manually
add it under dependencies in package.json file

How to get mysqlx npm package?

I want to use MySQL document store. For this, I have gone through MySQL documentation. As per documentation, I need to use 'mysqlx' npm package. But when I searched for 'mysqlx' package on npm website. I got '#mysql/xdevapi' package. I am confused which npm package should I use for MySQL document store.
Kindly suggest.
Changes in MySQL Connector/Node.js 1.0.4 (2016-10-10, Milestone 3):
Changed package name from mysqlx to #mysql/xdevapi
In our application folder copy the MySQL Connector/Node.js tar.gz file.
Once it has copied, run the following command to add the package to our application:
$ npm install mysql-connector-nodejs-1.0.5.tar.gz
From MySQL Connector/Node.js::README.md:
Installation
------------
This library is organized in a way that it can be installed using Node.js's npm
tool into your project:
`npm install mysql-connector-nodejs-1.0.5.tar.gz`
or diectly from npmjs.com:
`npm install #mysql/xdevapi`
Please refer to http://npmjs.com for more information on npm.

Deploy meanjs into cloud9 IDE

I'm starting to develop with the stack meanjs. I'm using Cloud9 as a cloud IDE (I need its team functionalities). I tried previously to install mean in my local machine successfully. My problem arise when I try to install it in my cloud9 workspace. Does anybody know how to do it? I tried this https://github.com/meanjs/mean/issues/4 but it's not working.
Thank you so much in advance.
What you need to do is just following the steps that I listed in command line. I found the solution from youtube.
https://www.youtube.com/watch?v=RQ1HqBjT890
First, you need to utilize mongoDB. Type following:
echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
mkdir data
echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$#"' > mongod
chmod a+x mongod
./mongod
At this point, your mongoDB server is running. Then, you need to install node package manager, update it. Also, install yo generator.
npm install npm -g
npm update
npm install -g yo
npm install -g generator-meanjs
Then, create your project directory, create your mean app.
mkdir myMeanProject
cd myMeanProject
yo meanjs
Open a new terminal window, and run server.
cd myNewProject
grunt