Sailsjs - sails lift command is not working on windows - sails.js

I'm new to sailsjs. I created a new simple application with sailsjs and after run sails lift I got following error. Could you please anyone have an idea about this issue and tell how fix this.
Thanks.
info: Starting app...
C:\Users\kavi\AppData\Roaming\npm\node_modules\sails\errors\warn.js:48
'The local Sails dependency installed at `' + pathTo.localSails + '` ' +
^
ReferenceError: pathTo is not defined
at Object.module.exports.badLocalDependency (C:\Users\kavi\AppData\Roaming\n
pm\node_modules\sails\errors\warn.js:48:53)
at Sails.isLocalSailsValid (C:\Users\kavi\AppData\Roaming\npm\node_modules\s
ails\lib\app\private\isLocalSailsValid.js:51:14)
at Function.bound [as isLocalSailsValid] (C:\Users\kavi\AppData\Roaming\npm\
node_modules\sails\node_modules\lodash\dist\lodash.js:729:21)
at Command.module.exports (C:\Users\kavi\AppData\Roaming\npm\node_modules\sa
ils\bin\sails-lift.js:48:13)
at Command.<anonymous> (C:\Users\kavi\AppData\Roaming\npm\node_modules\sails
\node_modules\commander\index.js:249:8)
at Command.EventEmitter.emit (events.js:98:17)
at Command.parseArgs (C:\Users\kavi\AppData\Roaming\npm\node_modules\sails\n
ode_modules\commander\index.js:477:12)
at Command.parse (C:\Users\kavi\AppData\Roaming\npm\node_modules\sails\node_
modules\commander\index.js:370:21)
at Object.<anonymous> (C:\Users\kavi\AppData\Roaming\npm\node_modules\sails\
bin\sails.js:144:9)
at Module._compile (module.js:456:26)

Run npm install in your project root folder and after sails lift.

follow these steps,
1: npm install sails -g
2: npm install
note-run these commands as administrator

Related

How to make the kline node js command work?

I try to execute the node kline command, but it gives me an error:
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'C:\Program Files\nodejs\kline'
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}
Although npm install kline was successful. Tell me, maybe I missed something.
From what I gathered the kline module doesn't seem to be designed for the command line. Besides this to install a package which should run from the command line, e.g. nodemon, you should add the -g flag to the npm install command. This will install your package in the global npm scope which also supports calling these packages as a command, if supported.

Protractor exited with error code 100 when run config.js

A few days ago, my protractor was working fine. But yesterday when I tried to run the same tests, I got:
E/launcher - Error: Error: Cannot find module 'jasmine-reporters'
Require stack:
- D:\Repos\POS\config\config_c80_checkScreen.js
- C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\built\configParser.js
- C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\built\launcher.js
- C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\built\cli.js
- C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\bin\protractor
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
at Function.Module._load (internal/modules/cjs/loader.js:686:27)
at Module.require (internal/modules/cjs/loader.js:848:19)
at require (internal/modules/cjs/helpers.js:74:18)
at onPrepare (D:\Repos\POS\config\config_c80_checkScreen.js:62:28)
at C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\built\util.js:46:49
at Function.promise (C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:682:9)
at Object.runFilenameOrFn_ (C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\built\util.js:38:16)
at C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\built\runner.js:98:27
at _fulfilled (C:\Users\ingridd\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
Closing report
[11:03:30] E/launcher - Process exited with error code 100
On my project folder, I have the protractor-jasmine2-screenshot-reporter folder as you can see on the screenshot
jasmine2 folder
Please see where the ENV var is located
env var
The last thing I tried was to update the web driver and install the latest protractor. But I still get the same error.
Any suggestion is appreciated.
Error 100 is RUNNERS_FAILED_EXIT_CODE which is because there is an unexpected error. The error looks like you are missing the jasmine-reporters. npm install -S jasmine-reporters should fix it.

Running SASS on Gatsby not working

Yesterday, I was able to setup a starter-pack instance of gatsby and deploy to github pages.
Since then, I've updated my react/js files locally, which seemed to run fine locally. Now I want to compile my sass:
I can't find a decent solution which works:
Here's the sass compiler I tried to install:
sass --watch assets/scss/main.scss:assets/css/style.css
Node sass watch runs, but doesn't actually compile anything. I get an error instead:
Problems:
1) Since installing the sass
./src/assets/scss/main.scss
Module parse failed: /Users/reenaverma/development/GATSBY/src/assets/scss/main.scss Unexpected character '#' (1:8)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '#' (1:8)
at Parser.pp$4.raise (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2221:15)
at Parser.pp$7.getTokenFromCode (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2756:10)
at Parser.pp$7.readToken (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2477:17)
at Parser.pp$7.nextToken (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2468:15)
at Parser.pp$7.next (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2413:10)
at Parser.pp.eat (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:536:12)
at Parser.pp$1.parseStatement (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:728:71)
at Parser.pp$1.parseTopLevel (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:638:25)
at Parser.parse (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:516:17)
at Object.parse (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:3098:39)
at Parser.parse (/Users/reenaverma/development/GATSBY/node_modules/webpack/lib/Parser.js:902:15)
at NormalModule.<anonymous> (/Users/reenaverma/development/GATSBY/node_modules/webpack/lib/NormalModule.js:104:16)
at NormalModule.onModuleBuild (/Users/reenaverma/development/GATSBY/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
at nextLoader (/Users/reenaverma/development/GATSBY/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
at /Users/reenaverma/development/GATSBY/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
at Storage.finished (/Users/reenaverma/development/GATSBY/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
at /Users/reenaverma/development/GATSBY/node_modules/graceful-fs/graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:528:3)
# ./src/layouts/index.js 29:0-35
2) I've even tried this link, but this doesn't work either:
https://www.npmjs.com/package/gatsby-plugin-sass
3) For some reason, I also can't deploy to Github/git push origin master / npm run deploy
error: ./src/assets/scss/main.scss
Module parse failed: /Users/reenaverma/development/GATSBY/src/assets/scss/main.scss Unexpected character '#' (1:8)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '#' (1:8)
at Parser.pp$4.raise (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2221:15)
at Parser.pp$7.getTokenFromCode (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2756:10)
at Parser.pp$7.readToken (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2477:17)
at Parser.pp$7.nextToken (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2468:15)
at Parser.pp$7.next (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:2413:10)
at Parser.pp.eat (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:536:12)
at Parser.pp$1.parseStatement (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:728:71)
at Parser.pp$1.parseTopLevel (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:638:25)
at Parser.parse (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:516:17)
at Object.parse (/Users/reenaverma/development/GATSBY/node_modules/acorn/dist/acorn.js:3098:39)
at Parser.parse (/Users/reenaverma/development/GATSBY/node_modules/webpack/lib/Parser.js:902:15)
at NormalModule.<anonymous> (/Users/reenaverma/development/GATSBY/node_modules/webpack/lib/NormalModule.js:104:16)
at NormalModule.onModuleBuild (/Users/reenaverma/development/GATSBY/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
at nextLoader (/Users/reenaverma/development/GATSBY/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
at /Users/reenaverma/development/GATSBY/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
at Storage.finished (/Users/reenaverma/development/GATSBY/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
# ./src/layouts/index.js 28:0-35
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-default#1.0.0 deploy: `gatsby build --prefix-paths && gh-pages -b master -d public`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-default#1.0.0 deploy 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! /Users/reenaverma/.npm/_logs/2018-05-30T13_34_31_289Z-debug.log
PLEASE HELP! I need this sorted by tonight:
Here's my code from yesterday.... But I have updated 3 js files. But this works locally. Seems trying to run sass is breaking my work:
https://github.com/ReenaVerma/reenaverma.github.io/tree/master
The following 2 steps has helped me:
1) run npm install gatsby-plugin-sass to download sass plugin for Gatsby;
2) add gatsby-plugin-sass to plugins section of the gatsby-config.json file.

Cakefile not requiring *.coffee files

I have the following files:
Cakefile:
require './test'
test.coffee:
console.log 'hi'
another_test.coffee:
require './test'
If I run cake, I get the following exception:
module.js:340
throw err;
^
Error: Cannot find module './test'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/jose/Desktop/Cakefile:2:3)
at Object.<anonymous> (/Users/jose/Desktop/Cakefile:4:4)
at Module._compile (module.js:456:26)
However, if I run coffee another_test.coffee, I get this output:
hi
I installed node using brew and coffee-script using npm, and am using the following versions:
$ node -v
v0.10.24
$ npm -v
1.3.21
$ coffee -v
CoffeeScript version 1.7.1
Why can't Cakefile require test.coffee?
Solved by adding:
require 'coffee-script/register'
on top of Cakefile. See: https://stackoverflow.com/a/21678007/347915
Have you tried using an absolute path ? Try this instead :
require "#{__dirname}/test"

Cannot run Mocha with CoffeeScript

Makefile - Content:
REPORTER = dot
all: build
build:
#./node_modules/coffee-script/bin/coffee \
-c \
-o lib src
clean:
rm -rf lib
mkdir lib
watch:
#./node_modules/coffee-script/bin/coffee \
-o lib \
-cw src
test:
#./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
test/*.coffee
.PHONY: build clean watch test
The project root directory has a test folder with two files: mocha.opts and example.coffee
example.coffee - Content
describe "feature", ->
it "should add two numbers", ->
(2+2).should.equal 4
On running make test, getting the following error:
cribe 'feature',
^^^^^^^^^
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected string
at Module._compile (module.js:429:25)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at /home/my_username/testcode/coffeepress/node_modules/mocha/bin/_mocha:261:27
at Array.forEach (native)
at load (/home/my_username/testcode/coffeepress/node_modules/mocha/bin/_mocha:258:9)
at Object.<anonymous> (/home/my_username/testcode/coffeepress/node_modules/mocha/bin/_mocha:249:1)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
Running Mocha with js files succeeds, but cannot get it to run with CoffeeScript. I really want to - for code brevity.
Please guide.
As of Mocha 1.0:
coffee-script is no longer supported out of the box. CS and similar transpilers may be used by mapping the file extensions (for use with --watch) and the module name. For example --compilers coffee:coffee-script with CoffeeScript 1.6- or --compilers coffee:coffee-script/register with CoffeeScript 1.7+.
(Quoting http://visionmedia.github.io/mocha/#compilers-option) So, you need to add the line
--compilers coffee:coffee-script/register
or, for CS <= 1.6.x,
--compilers coffee:coffee-script
to your mocha.opts file.
From CoffeeScript 1.7 onwards, the option should be:
--compilers coffee:coffee-script/register
An issue was filed on Mocha's github site.
Apparently, a change in Mocha made in April 2018 (softly) deprecated the --compilers option. In the command line you now get:
(node:27864) DeprecationWarning: "--compilers" will be removed in a future version of Mocha; see https://git.io/vdcSr for more info
Like the link says, this can easily be fixed by just not using --compilers and using this new (simplified) mocha.opts options:
--require coffeescript/register
test/*.coffee
The last line is needed to make Mocha understand it should now use *.coffee files as test files. This seems not to be covered with the --require option.
mocha --require coffeescript/register
Source: https://github.com/mochajs/mocha/wiki/compilers-deprecation
with the latest update of mocha the the require statement must written in package.json file as
"mocha":{
"require":"coffeescript",
"reporter":"spec"
},
I needed two changes to my mocha args to get this to work:
--require coffee-script/register
--compilers coffee:coffee-script/register