Uncaught ReferenceError: angular is not defined - Mean.IO - node.js

I have followed the steps to install mean.io, but when I browse the localhost:3000 I get a blank page and when I open the console I get a list of files pointing to the same error:
Uncaught ReferenceError: angular is not defined
my issue is something similar to this, but I re-installed bower and it didn't work I'm still getting the error.
I'm trying to install this in ubuntu 14.04
this is the screen I get:
Do I need to perform some sort of modification to any script, file reference or configuration, any suggestions?

I had the same problem and I solved in this way:
You need to install or reinstall "bower"
Check your bower.json file, it should look something like this:
{
"name": "mean",
"version": "0.3.0",
"dependencies": {
"angular": "latest",
"angular-resource": "latest",
"angular-cookies": "latest",
"angular-mocks": "latest",
"angular-route": "latest",
"bootstrap": "latest",
"angular-bootstrap": "0.10.0",
"angular-ui-router": "#master"
}
}
and then run the following command:
  sudo bower install --allow-root
This will install to "Angular" in the project

I had the same problem but for some reason the top answer here (reinstalling bower and running sudo bower install --allow-root) didn't work for me.
However the answer form this stackoverflow thread worked -> bower command not found Basically the author there said I wasn't setting npm prefix properly and to fix that the following was required:
$ npm config set prefix /usr/local
$ npm install -g bower

note the it is bad form to install mean.io as root and as a result run bower or npm as root.
We actually built processes into mean-clithat will disallow running as root.
Running as root is the sure way to expose mean to more serious security issues and to "contaminating" you .npm and .bower caches with a mix of normal and root based permissions which is very frustrating for "newbies"

If you are behind the proxy, then still problem not solved. So in order to solve it you need to include proxy-setting in .bowerrc file as
{
"directory": "public/lib",
"proxy":"http://user:passwd#server:port",
"https-proxy":"http://user:passwd#server:port"
}
Now run
sudo npm install -g bower
sudo bower install --allow-root

Related

Can't install laravel-elixir because of node-sass failure

I am pretty new to this environment still and am trying to get up to speed on node.js modules and Laravel (5.1.11) as a whole, so...
I have a fresh install of Laravel implemented by the cPanel Installitron. I'm using PHPStorm to install all of the node modules via the provided package.json:
package.json
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^3.0.0",
"bootstrap-sass": "^3.0.0"
}
}
The error I get when I run the install is:
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":
HTTP error 404 Not Found
I can understand why this would happen, seeing as that is an older version of node-sass, but how do I know what newer versions are compatible with the requested version of laravel-elixir? I didn't want to just install a newer version of node-sass because digging a deeper hole would make it harder for me to find a solution to my problem. What is the fix for this?
It looks like you can fix this by installing Windows Build Tools via this command:
npm install --global --production windows-build-tools
Then delete the project's node_modules folder and re-run npm install.
Just follow this official url well doc.: https://laravel.com/docs/5.3/elixir if you get any error. I just comment and i ll be here.

Unable to resolve module `react/lib/ReactComponentTreeHook`

I'm attempting to upgrade React Native and I'm running into the following:
error: bundling: UnableToResolveError: Unable to resolve module `react/lib/ReactComponentTreeHook` from `/Users/anthony/dev/apptova-react/node_modules/react-native/Libraries/Performance/Systrace.js`: Module does not exist in the module map or in these directories:
/Users/anthony/dev/apptova-react/node_modules/react-native/node_modules/react/lib
, /Users/anthony/dev/apptova-react/node_modules/react/lib
I'm so confused. I can't find any library named ReactComponentTreeHook in node_modules, anywhere.
I've tried removing the node_modules folder and reinstalling, nada. I've also cleared watchman watches and reset the packager cache.
EDIT: I kept running into issues that seemed to stem from react-native-maps so I so I reset back to a working stable version, uninstalled react-native-maps, and ran react-native-git-upgrade (again).
Now I'm getting:
error: bundling: UnableToResolveError: Unable to resolve module `react/lib/ReactDebugCurrentFrame` from `/Users/anthony/dev/apptova-react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js`: Module does not exist in the module map or in these directories:
/Users/anthony/dev/apptova-react/node_modules/react-native/node_modules/react/lib
, /Users/anthony/dev/apptova-react/node_modules/react/lib
I'm just trying to latest, my package.json dependencies are simple so I don't think its conflicts with a third-party code base:
"dependencies": {
"react": "15.4.1",
"react-native": "^0.43.1",
"react-native-drawer": "^2.3.0"
},
"devDependencies": {
"babel-jest": "18.0.0",
"babel-plugin-transform-flow-strip-types": "^6.21.0",
"babel-preset-react-native": "1.9.1",
"deepmerge": "^1.3.2",
"flow-bin": "^0.37.4",
"jest": "18.0.0",
"react-test-renderer": "15.4.1"
},
Again, went throught the process of clearing watchman watches, node modules, reseting package manager and still get this error.
EDIT 2: After spending two solid days of trying to get this working I created a new blank project and migrated my code over.
Make sure version in your package.json file is the version you want.
For example, "react-native: ^0.43.3" is not same as "react-native: 0.43.3".
Clean up and re-install everything.
If the error still there, then try to install react-native-git-upgrade
$ npm install -g react-native-git-upgrade
and then run
$ react-native-git-upgrade x.y.z(version you want to upgrade to)
for me it works.
If your version is too old, then you should follow the old version document to upgrade.
This could also happen if you don't have the correct version of react required by the version of react-native. If this is the case, you would get a warning like this when you run npm install.
npm WARN react-native#0.43.4 requires a peer of react#16.0.0-alpha.6 but none was installed.
To fix this problem, stop the react packager and upgrade the version of react by running the following command
npm install -save react#16.0.0-alpha.6
Now, re-run the app and hopefully the issue would go away.
I think recently many of the modules under react/lib were moved to react-dom/lib, which is why the packager can't find some modules
I followed following steps and it's working
• Deleted node_modules folder
• Replaced ^16.0.0-alpha.6 with "react": "16.0.0-alpha.3"
• npm install
• react-native run-android

Laravel elixir not found when running gulp in cli

It has been pretty frustrating finding the solution to this problem today, as I've tried searching on Google and went to all of different forums and websites in search of a solution, but none of them worked for me.
Is there anyone who could tell me what I could try in order to solve this?
Facts:
Fresh Laravel installation
Ran npm install
Ran npm install gulp
Ran gulp
Got this error
package.json contents
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^4.0.0",
"bootstrap-sass": "^3.0.0"
}
}
try to remove the node_modules directory completely and issue npm install or npm install --no-bin-links without gulp, gulp should already included in packages.json
Very old question I know, but, if still having issue...
Try to run
npm install laravel-elixir --save-dev
command manually on prompt.
And then make sure you added following code line in gulpfile.js file
var elixir = require('laravel-elixir');

npm install not working in windows 7 without giving any error

I am new to node and have installed latest version of nodejs on windows 7 from windows installer for node.
For me node install is not working without giving any error.
After giving command
npm install -g express
Cursors just waits and waits without showing any error message
node(v 0.12.2) and npm(v2.7.4)
Any help is highly appreciated. Thanks!!
had the same problem once,
in case you installed some node packages before and there is already an node_modules folder try to delete it manually and rerun the npm install command.
alternatively try to create a package.json file like this:
package.json
{
"name": "module-name",
"version": "1.0.0",
"description": "",
"author": "Your Name",
"dependencies": {
"express": "4.2.x"
},
"license": ""
}
and run npm install in that folder
EDIT:
just mentioned you try to install express globally, this is not needed, express is installed via npm install express --save (--save creates a dependency in the package.json file).
npm install express --save
express-generator
Another option would be to install the express-generator ,this one is installed globally ;)
npm install express-generator -g
and generate your initial project this way
check the proxy settings.
npm config get proxy
If proxy is correct then you might had cancelled the installation in the middle.
If you had done so, delete the folder named "node_modules" in your current directory (installation folder)which will be created while installation.
and restart the install (type npm install )

npm install not working on windows with git dependencies

So, in my package.json I have, in dependencies, besides some npm modules, some private git repositories from my company:
devDependencies": {
"async": "^0.9.0",
"build-tools": "git+ssh://git#github.com/mycompany/repo.git#master",
"chai": "^1.9.2",
"download": "^0.2.1",
.....
}
If i run npm install, it's working almost everywhere.
We mostly use Macs, but there's also another colleague running gitbash on windows and he has no problems with it.
I have a colleague with the same setup, windows and gitbash, that when we try to run npm install he gets the error:
fatal: ambiguous argument 'origin/HEAD': unknown revision or path not in the working tree
Also, when we change #master to #commit-sha npm installs successfully, so it's not a problem with authentication or whatever.
He is running Git for windows 1.9.4 and npm#latest (2.2.0).
Any help will be much appreciated.
Apparently cleaning up the npm-cache in the [USER]\AppData\Roaming\ folder, then re-installing npm fixes the problem.

Resources