symfony webpacke encore node-sass install error - symfony

I am cloning the Symfony project form git repository. Project is using webpack encore.
git clone
composer install
npm install
but this produce error in node-sass

Try to rebuild if npm package creates error
npm rebuild node-sass

the problem was solved by running npm install by host machine, because composer install was running also in host machine

Related

Unable to find local grunt on ubuntu

I installed grunt globally by running the following commands
npm install grunt grunt-cli -g
And I also installed grunt and other project dependencies locally to my project by running
npm install
npm install grunt --save-dev
But grunt keeps telling me "Unable to find local grunt"
I'm Using ubuntu 16.04 on DigitalOcean and I have nodejs and npm installed
what is the problem?

Firebase: Cannot start emulator

functions: Cannot start emulator. Error: Cannot find module '#google-cloud/functions-emulator/src/config'
This is the error message I get when I try to run functions locally on Mac. My Firebase version is 3.16.0. I tried doing sudo npm install -g #google-cloud/functions-emulator as well. But still no use. Please help.
Solution is:
yarn global add firebase-tools
yarn global add #google-cloud/functions-emulator --ignore-engines
Working Solution!(OSX) None of the above worked for me. After a long struggle, I found the following solution.
cd my_project/functions
npm install #google-cloud/functions-emulator
Copy #google-cloud/functions-emulator folder generated inside node_modules.
cd /usr/local/lib/node_modules/#google-cloud && open .
Paste the functions-emulator folder here.
In your project's root directory, copy package.json inside functions/node_modules/#google-cloud/functions-emulator
cd /usr/local/lib && open .
Paste the package.json here.
npm install
Hurray! You are good to go. Now go back to your project's root directory and run.
sudo firebase serve --only hosting,functions
And the emulator should start normally.
Note: Do not run sudo npm install -g #google-cloud/functions-emulator since the files will be removed and reinstalled. This is where the installation fails and emulator fails to run.
Hope this helps!
The following worked for me.
npm uninstall -g firebase-tools && npm i -g firebase-tools
npm i --save #google-cloud/firestore
npm i --save #google-cloud/common-grpc
npm i -g #google-cloud/functions-emulator
npm i --save firebase-functions
current package.json snippet
"dependencies": {
"#google-cloud/common-grpc": "^0.5.3",
"#google-cloud/firestore": "^0.11.1",
"firebase-functions": "^0.8.1",
"firebase-admin": "5.8.1"
}
My system: Ubuntu 16.04.3
I had the same problem and the reason is that "#google-cloud/functions-emulator" is not installed in the 'npm global packages folder'.
In my case it happened because I installed firebase-tools globally using yarn, and I used it because when installing firebase-tools globally using npm I was getting an folder access error, which did not happen with yarn.
What I did to solve the problem was to follow these simple instruction from npm website to use a different folder for npm global packages (https://docs.npmjs.com/getting-started/fixing-npm-permissions).
Then I installed again with 'npm install -g firebase-tools' (without sudo) and it worked perfectly.
I had the same problem, using Ubuntu 17.10.
Note: You do not need to, and should not, use sudo for the installation.
I resolved this by performing the following:
Uninstall any previously attempted installed of the functions emulator.
npm uninstall -g #google-cloud/functions-emulator
and to make sure:
yarn global remove #google-cloud/functions-emulator
Delete all files in ~/.config/configstore/#google-cloud/functions-emulator. Note that there are some hidden files in this directory.
rm -rf ~/.config/configstore/#google-cloud/functions-emulator
Install nvm (node version manager) by following the instructions here:
https://github.com/creationix/nvm#install-script
Use nvm to install a specific version of node - at the time of writing, the Google Cloud Function Emulator (version 1.0.0-alpha.29) specifically requires 6.11.5.
nvm install 6.11.5
Install the Google Cloud Platform SDK:
https://cloud.google.com/sdk/
Reinstall the functions emulator:
npm install -g #google-cloud/functions-emulator
Start the emulator to verify installation has succeeded:
functions start
IMPORTANT: Subsequently, when attempting to create a function that can be tested locally or deployed to Google Cloud, you should use the firebase init functions command within your project, and allow this to install dependencies via npm. A walkthrough of creating a test function with Firebase can be found here:
https://firebase.google.com/docs/functions/get-started

Unable to install Grunt ?

I've installed grunt :
sudo npm install -g grunt-cli
/Users/user/.nvm/versions/node/v4.3.0/bin/grunt -> /Users/user/.nvm/versions/node/v4.3.0/lib/node_modules/grunt-cli/bin/grunt
/Users/user/.nvm/versions/node/v4.3.0/lib
└── grunt-cli#1.2.0
But when i run grunt i have errors:
grunt
grunt-cli: The grunt command line interface (v1.2.0)
Fatal error: Unable to find local grunt.
If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:
http://gruntjs.com/getting-started
Where i am wrong please ?
you have to install grunt globally and locally
you have installed the cli globally with the -g flag
now you have to install it locally in your package.json with ...
npm install -SD grunt
then your "grunt" command will work - assuming you have a valid gruntfile
This looks like a duplicate of Fatal error: Unable to find local grunt.
In a nutshell, try running grunt:init or npm:init first (depending on the version you have. See linked question for more details.
install the command-line interface:
npm install -g grunt-cli
install the local task runner:
cd [my project root]
npm install grunt --save-dev
define your Gruntfile.js as per http://gruntjs.com/getting-started#the-gruntfile
run the tasks with: grunt

How can I install npm dependencies manually using meteor

I need to install npm dependencies described on my packages.json file manually (by manually I mean with a command like npm install or mrt install, that doesn't require to start the app).
I know that meteor-npm creates the npm directory inside packages and that when I start the app using mrt or meteor the npm modules get downloaded.
But I'm writing a test script and I need the modules to be installed before running the tests so I would need to install them as I install standard meteorite modules with mrt install.
In theory this is very easy, because you could just run npm install PACKAGENAME in your project directory. However, this would of course mess up meteor, which will try to interpret the new files as meteor files.
Instead, you have two options:
install in a super directory (they will be found): cd .. && npm install PACKAGENAME
install packages globally: npm install -g PACKAGENAME

"Fatal error: Unable to find local grunt." on Windows 7

I cannot get grunt to work at all on Windows 7. Following the instructions on the Grunt website (http://gruntjs.com/getting-started) I've run:
npm uninstall -g grunt-cli
npm uninstall grunt
npm uninstall -g grunt-init
git clone git#github.com:gruntjs/grunt-init-jquery.git c:/Users/me/.grunt-init/jquery
npm install -g grunt-cli
grunt-init jquery
npm install .
After that, running "grunt" produces the following output:
grunt-cli: The grunt command line interface. (v0.1.9)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
The output of npm list grunt is:
npm WARN package.json consolidate#0.9.1 No repository field.
npm WARN package.json jquery-plugin#0.0.0-ignored No repository field.
npm WARN package.json passport-local-examples-login#0.0.0 No repository field.
npm WARN package.json receiptly#0.0.1 No repository field.
npm WARN package.json cookie-signature#1.0.1 No repository field.
npm WARN package.json fresh#0.1.0 No repository field.
npm WARN package.json methods#0.0.1 No repository field.
npm WARN package.json range-parser#0.0.4 No repository field.
npm WARN package.json send#0.1.0 No repository field.
npm WARN package.json pause#0.0.1 No repository field.
npm WARN package.json policyfile#0.0.4 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json eyes#0.1.8 No repository field.
npm WARN package.json bytes#0.2.0 No repository field.
npm WARN package.json dateformat#1.0.2-1.2.3 No repository field.
npm WARN package.json uid2#0.0.2 No repository field.
C:\Users\me\AppData\Roaming\npm
└─┬ grunt-init#0.2.1
└── grunt#0.4.1
Running "npm install grunt" in the current directory gives the same error when running grunt.
Any thoughts? My understanding is that grunt-cli is meant to look for a local grunt install, but I can't work out why it can't find it.
I know its been 2 years since this question was asked. However if someone wants in future:
I got the exact same issue. And I got this fixed by installing grunt locally. As per grunt site,
Note that installing grunt-cli does not install the Grunt task runner!
The job of the Grunt CLI is simple: run the version of Grunt which has
been installed next to a Gruntfile. This allows multiple versions of
Grunt to be installed on the same machine simultaneously.
So I just got it working by installing Grunt locally.
npm install grunt --save-dev
--save : adds it to your package.json.
-dev: adds it as a dev dependency.
There must be a Gruntfile.js located in the directory you run the command from. Also double check that 'npm install grunt' actually gave you a node_modules directory with a sub directory called grunt.
You should install grunt in GUI mode.
Open node.js cmd prompt then open the root folder and run the below commands
npm install ( once it done you can able to see node_modules folder in the root folder)
npm install –g grunt-cli (change the version from ("version": "minified" to Current release("version":"1.11"); you should replace with minified once you run build)
grunt build:full
Note: Version has to change when running grunt very first time.
if the above answer do not works then you can try by using this
rm -rf node_modules/ && npm cache clean && npm install

Resources