Unable to use ember-cli without manually deleting "tmp" directory after every command - ember.js

I am new to Ember and just installed the ember-cli:
npm install -g ember-cli
and it seems to install fine:
D:\>ember -v
ember-cli: 2.7.0
node: 4.4.5
os: win32 x64
When I repeat the identical version command (ember -v), I get the following error message:
D:\>ember -v
fs.js:794
return binding.mkdir(pathModule._makeLong(path),
^
Error: EEXIST: file already exists, mkdir 'D:\tmp'
at Error (native)
at Object.fs.mkdirSync (fs.js:794:18)
at testCanSymlink (C:\Users\joeal_000\AppData\Roaming\npm\node_modules\ember-cli\node_modules\symlink-or-copy\index.js:18:6)
at Object.<anonymous> (C:\Users\joeal_000\AppData\Roaming\npm\node_modules\ember-cli\node_modules\symlink-or-copy\index.js:9:15)
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 Module.require (module.js:353:17)
at require (internal/module.js:12:17)
The first "ember -v" command creates a directory named "tmp" in directory that I am in when I issue the "ember" command. If I delete this "tmp" directory, everything works fine again:
D:\>rmdir /s tmp
tmp, Are you sure (Y/N)? y
D:\>ember -v
ember-cli: 2.7.0
node: 4.4.5
os: win32 x64
Here are my versions of node and npm:
D:\>node -v
v4.4.5
D:\>npm -v
2.15.5
How can I stop this behavior from occurring, whever I have to delete the "tmp" file after every ember command?
Thanks for the help.

ember-cli temporarily broken because of a dependent package.
The issue was resolved a few minutes ago: https://github.com/broccolijs/node-symlink-or-copy/issues/26#event-746775676
Just do npm install again after deleting your nodes_module directory.

try deleting all node modules directory, and do npm install, or better place your ember not in C drive

Related

pm2 'cluster' mode fail to load LD_LIBRARY_PATH

i'm installing a npm package ccap to generate CAPTCHA. Because it's a c++ add on and requires gcc 4.8 +,i met some problems while installing it.
I compiled gcc 4.9.4 and installed ccap successfully on my development machine.
However ,i met this wield problem when i try to start my application (without pm2).
Error: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/jwb/ccapDemo/node_modules/ccap/build/Release/hcaptha.node)
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Function._load (/home/jwb/ccapDemo/node_modules/pmx/lib/transaction.js:47:40)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/jwb/ccapDemo/node_modules/ccap/lib/hcap.js:4:13)
at Module._compile (module.js:570:32)
I googled a lot and got it fixed by setting following linux enviroment variable in .bash_profile.
export LD_LIBRARY_PATH=/home/jwb/gcc-4.9.4/lib64:$LD_LIBRARY_PATH
Now it seems like working ,but when i try to start my demo in PM2 cluster mode,the same problem occured.
I also tried pm2 fork mode,and it worked just fine.
So i figured maybe LD_LIBRARY_PATH can not be found in PM2 cluster mode.Then i printed process.env and found LD_LIBRARY_PATH.
So i think this problem is somehow related to PM2 cluster mode ,but i don't know how to fix it.
I do not have root authority and can not just update /usr/lib64/libstdc++.so.6 to a higher version. Have someone met same problem ?How should i solve it?
Software versions used
OS : Red Hat 6
gcc : 4.9.4 (default gcc version is 4.4.7)
node.js : 6.9.1
PM2 : 2.0.19

node Sass Support to current version environment (Ionic)

in the ionic app
trying to run ionic emulate ios but following error is coming
ionic-hello-world# ionic:build /Users/farrukhqamar/HybridApps/helloWorld
ionic-app-scripts build
keywords if/then/else require v5 option
/Users/farrukhqamar/HybridApps/helloWorld/node_modules/node-sass/lib/index.js:13
throw new Error(errors.unsupportedEnvironment());
^
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (51)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v3.10.1
at Object. (/Users/farrukhqamar/HybridApps/helloWorld/node_modules/node-sass/lib/index.js:13:11)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
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 Object. (/Users/farrukhqamar/HybridApps/helloWorld/node_modules/#ionic/app-scripts/dist/sass.js:11:19)
at Module._compile (module.js:571:32)
In the morning every thing was working but just start happening now in my current project
If i create a new project then it runs perfectly.
I am very new in ionic so please suggest some solution
Runtime (Node Module ABI) version 51 means it's an Electron environment, which node-sass doesn't directly support.

ember-cli gives "Unexpected end of JSON input"

I have recent node (7.1.0) and npm (4.0.2) installations on macOS Sierra 10.12.1 with Xcode 8.1. The installation of the ember-cli package seems to work fine apart from two warnings:
08:51 $ npm install -g ember-cli
npm WARN deprecated node-uuid#1.4.7: use uuid module instead
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/ember -> /usr/local/lib/node_modules/ember-cli/bin/ember
/usr/local/lib
└── ember-cli#2.9.1
But when I call ember it always gives me the following error:
08:52 $ ember --help
module.js:593
throw err;
^
SyntaxError: /Users/torstenkemps-benedix/package.json: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:590:27)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Function.Project.getProjectRoot (/usr/local/lib/node_modules/ember-cli/lib/models/project.js:662:13)
at module.exports (/usr/local/lib/node_modules/ember-cli/lib/cli/index.js:76:22)
at /usr/local/lib/node_modules/ember-cli/bin/ember:27:3
How can I get ember to run correctly?

ember-cli cleanup error when building

I had ember-cli installed on my computer and my app was running perfectly, but yesterday I formatted my computer and upgraded to windows 10 and tried to install ember-cli exactly the same way it was before but now when I try to build or run my application I get this error:
Future versions of Ember CLI will not support v4.2.1. Please update to Node 0.12 or io.js.
version: 1.13.8
Cleanup error.
ENOTEMPTY: directory not empty, rmdir 'C:\Software\company\product\client-side\product2\tmp\concat_with_maps-output_path-jfPUvJvW.tmp'
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Software\company\product\client-side\product2\tmp\concat_with_maps-output_path-jfPUvJvW.tmp'
at Error (native)
at Object.fs.rmdirSync (fs.js:763:18)
at rmkidsSync (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\node_modules\quick-temp\node_modules\rimraf\rimraf.js:247:11)
at rmdirSync (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\node_modules\quick-temp\node_modules\rimraf\rimraf.js:237:7)
at fixWinEPERMSync (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\node_modules\quick-temp\node_modules\rimraf\rimraf.js:150:5)
at Function.rimrafSync [as sync] (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\node_modules\quick-temp\node_modules\rimraf\rimraf.js:216:26)
at Object.remove (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\node_modules\quick-temp\index.js:26:12)
at ReadCompat.cleanup (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\read_compat.js:69:13)
at ConcatWithMaps.Plugin.cleanup (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\index.js:113:49)
at cleanupTree (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli\lib\builder.js:147:17)
Build failed.
ENOENT: no such file or directory, open 'C:\Software\company\product\client-side\product2\tmp\concat_with_maps-input_base_path-QzODcQgu.tmp\0\C:\Software\company\product\client-side\product2\tmp\concat_with_maps-input_base_path-QzODcQgu.tmp\0\ember-basic-dropdown\components\basic-dropdown.js'
Error: ENOENT: no such file or directory, open 'C:\Software\company\product\client-side\product2\tmp\concat_with_maps-input_base_path-QzODcQgu.tmp\0\C:\Software\company\product\client-side\product2\tmp\concat_with_maps-input_base_path-QzODcQgu.tmp\0\ember-basic-dropdown\components\basic-dropdown.js'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at SourceMap.addFile (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\fast-sourcemap-concat\lib\source-map.js:68:19)
at ConcatWithMaps.<anonymous> (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\concat-with-maps.js:96:17)
at Array.forEach (native)
at ConcatWithMaps.addFiles (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\concat-with-maps.js:93:9)
at ConcatWithMaps.build (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\concat-with-maps.js:65:8)
at C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\broccoli-sourcemap-concat\node_modules\broccoli-caching-writer\index.js:152:21
at lib$rsvp$$internal$$tryCatch (C:\Software\company\product\client-side\product2\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:493:16)
node v4.2.1
npm v2.14.7
But I've tried with others versions and the problem persisted.
The same application is working perfectly on another computer which also has windows 10 and the same node and npm versions.
If you need any extra information leave a comment and I'll edit the question.
I had the same problem today. It seems there's a bug in a dependency module:
"name": "fast-sourcemap-concat",
"version": "0.2.6"
it does not handle properly Windows paths starting with drive letters, like C:/.
For now, I fixed it manually in fast-sourcemap-concat/lib/source-map.js, function _resolveFile, line 55, changing:
if (this.baseDir && filename.slice(0,1) !== '/') {
to:
if (this.baseDir && filename.slice(0,1) !== '/' && filename.slice(1,3) !== ':/') {
Seems to fix the issue for me. Good luck!
This was fixed in https://github.com/ember-cli/ember-cli/issues/5055
You will need to reinstall your node modules:
rm -rf node_modules
npm cache clear
npm install
Try to reinstall Ember CLI in your project directory (local version). You can follow the steps from Ember CLI GitHub releases page - start with rm -rf node_modules bower_components dist tmp and continue following Project Update guide.

PHPUnit Extension warning in Yii

I am setting up unit testing to work with the Yii framework. Apart from Yii, my PHPUnit works great. But along with Yii when I try to test it, it gives me the following warning every time.
Warning: include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream:
No such file or directory in D:\xampp\htdocs\yii1112\framework\YiiBase.php on li
ne 423
Warning: include(): Failed opening 'PHPUnit_Extensions_Story_TestCase.php' for i
nclusion (include_path='.;D:\xampp\htdocs\sms_dev\protected\extensions\yii-mail;
D:\xampp\htdocs\sms_dev\protected\extensions\giix-components;D:\xampp\htdocs\sms
_dev\protected\components;D:\xampp\htdocs\sms_dev\protected\models;D:\xampp\php\
PEAR') in D:\xampp\htdocs\yii1112\framework\YiiBase.php on line 423
I have searched a lot and have also asked in the Yii forum, but nothing seems to be working out.
Does anyone have any idea what this warning means? How can I get rid of it?
The file PHPUnit_Extensions_Story_TestCase.php is part of the package PHPUnit_Story, which can be installed with:
pear install phpunit/PHPUnit_Story
See also: PHPUnit can't find PHPUnit_Extensions_Story_TestCase. What package is missing?
The protected/tests directory is not in your include path. I would suggest moving your protected directory from any public location, and just add the protected folder to the include path. so d:\xampp\htdocs\sms_dev\protected\ instead of listing each directory seperately.
Either this is the problem or the file doesn't exist and you have to check your code.
With pear install dependencies [ Now pear packages are not updated better install with composer ]
sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit_Story
sudo pear install phpunit/PHP_Selenium
Better if you install phpunit with composer these errors will not come
step 1:
Create a composer.json file in your project root:
{
"require-dev": {
"phpunit/phpunit": "4.6.*",
"phpunit/phpunit-selenium": ">=1.4",
"phpunit/dbunit": ">=1.3",
"phpunit/phpunit-story": "*",
"phpunit/php-invoker": "*"
},
"autoload": {
"psr-0": {"": "src"}
},
"config": {
"bin-dir": "bin/"
}
}
step 2:
Install composer into your project using:
curl -sS https://getcomposer.org/installer | php
Ensure composer is executable:
chmod +x composer.phar
Let composer install the dependencies:
./composer.phar install --dev
Check you have a project specific phpunit version installed:
bin/phpunit --version
the above specified is a softlink
ls -la bin/phpunit
bin/phpunit -> ../vendor/phpunit/phpunit/phpunit
Afterwords you can make softlink of 'phpunit' from vendor directory into directory of php in use.
This will remove all warnings related to
PHP Warning: include(classes/PHPUnit_Extensions_Story_TestCase.php)
PHP Warning: include(): Failed opening 'classes/PHPUnit_Extensions_Story_TestCase.php'
PHP Warning: include(classes/Composer\Autoload\ClassLoader.php)