Sep 22, 2018

solved install nodejs but can not update npm module

the solution is
install nodejs without npm

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.
Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.
Run the following commands to remove all existing global npm modules, uninstall node & npm, re-install node with the correct defaults, configure the location for global npm modules to be installed, and then install npm as its own pacakge.
rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sh
Node and npm should be correctly installed at this point. The final step is to add ~/.npm-packages/bin to your PATH so npm and global npm packages are usable. To do this, add the following line to your ~/.bash_profile:
export PATH="$HOME/.npm-packages/bin:$PATH"
Now you can re-install any global npm packages you need without any problems.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:
$ npm update npm -g
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/1.4.4
npm http 304 https://registry.npmjs.org/npm/1.4.4
npm ERR! error rolling back Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
npm ERR! error rolling back     at clobberFail (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:57:12)
npm ERR! error rolling back     at next (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:43:14)
npm ERR! error rolling back     at /usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:52:12
npm ERR! error rolling back     at Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back  npm@1.4.4 { [Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm] code: 'EEXIST', path: '/usr/local/bin/npm' }
npm ERR! Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
File exists: /usr/local/bin/npm
Move it away, and try again. 

npm ERR! System Darwin 13.1.0
npm ERR! command "/usr/local/Cellar/node/0.10.26/bin/node" "/usr/local/bin/npm" "update" "npm" "-g"
npm ERR! cwd /Users/dan/Google Drive/Projects/dotfiles
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/local/bin/npm
npm ERR! code EEXIST
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/dan/Google Drive/Projects/dotfiles/npm-debug.log
npm ERR! not ok code 0

There's an NPM bug for this exact problem. The bug has been "fixed" by Homebrew installing npm in a way that allows it to manage itself once the install is complete. However, this is error-prone and still seems to cause problems for some people. The root of the the issue is really that npm is its own package manager and it is therefore better to have npm manage itself and its packages completely on its own instead of letting Homebrew do it.

Also, using the Homebrew installation of npm will require you to use sudo when installing global packages. Since one of the core ideas behind Homebrew is that apps can be installed without giving them root access, this is a bad idea.

about rimraf, this is solution :



# Create a script somewhere in your $PATH
echo 'exec rm -rf "$@"' >> /usr/local/bin/rimraf

# Make it executable
chmod +x /usr/local/bin/rimraf


taken from : https://gist.github.com/DanHerbert/9520689 

Read more ...

Sep 21, 2018

[SOLVED] Error: EACCES: permission denied



the issue are :

oh oh Error: EACCES: permission denied, open '/usr/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.bash'


npm package fails to install "npm ERR! Error: EACCES: permission denied"


can not install serverless on Mac Os


the solution is : 



sudo ln -sf /usr/local/Cellar/node/6.0.0/lib/node_modules/serverless/bin/serverless /usr/local/bin/serverless



Read more ...

Sep 2, 2018

create manual tabs on odoo 11 without snippet

just put this code to your view



<div>
                    <!-- Thumbnail -->
                    <div class="oe_snippet_thumbnail">
                        <img class="oe_snippet_thumbnail_img" src="/website_tabs/static/src/img/thumbnail.png" />
                        <span class="oe_snippet_thumbnail_title">Tabs</span>
                    </div>

                    <!-- Snippet Body -->
                    <section class="oe_snippet_body cst mt16 mb16">
                        <div class="container">
                            <div class="row">
                                <div role="tabpanel">
                                    <!-- Nav tabs -->
                                    <ul class="nav nav-tabs" role="tablist">
                                        <li role="presentation" class="active"><a href="#tab1" aria-controls="tab1" role="tab" data-toggle="tab">Text Block</a></li>
                                        <li role="presentation"><a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab">Text-Image</a></li>
                                        <li role="presentation"><a href="#tab3" aria-controls="tab3" role="tab" data-toggle="tab">Image-Text</a></li>
                                    </ul>
                                    <!-- Tab panes -->
                                    <div class="tab-content">
                                        <div role="tabpanel" class="oe_structure oe_empty tab-pane active" id="tab1">
                                            <section class="mb16">
                                                <!-- Text Block snippet -->
                                                <div class="container">
                                                    <div class="row">
                                                        <div class="col-md-12 text-center mt16 mb32">
                                                            <h2>A Great Headline</h2>

                                                            <h3 class="text-muted">A good subtitle</h3>
                                                        </div>

                                                        <div class="col-md-12 mb16 mt16">
                                                            <p>A great way to catch your reader's attention is to tell a
                                                            story. Everything you consider writing can be told as a
                                                            story.</p>

                                                            <p><b>Great stories have personality.</b> Consider telling a
                                                            great story that provides personality. Writing a story with
                                                            personality for potential clients will asist with making a
                                                            relationship connection. This shows up in small quirks like
                                                            word choices or phrases. Write from your point of view, not
                                                            from someone else's experience.</p>

                                                            <p><b>Great stories are for everyone even when only written for
                                                            just one person.</b> If you try to write with a wide general
                                                            audience in mind, your story will ring false and be bland. No
                                                            one will be interested. Write for one person. If it’s genuine
                                                            for the one, it’s genuine for the rest.</p>
                                                        </div>
                                                    </div>
                                                </div>
                                            </section>
                                        </div>
                                        <div role="tabpanel" class="oe_structure oe_empty tab-pane" id="tab2">
                                            <section class="mt16 mb16">
                                                <!-- Text-Image snippet -->
                                                <div class="container">
                                                    <div class="row">
                                                        <div class="col-md-6 mt16">
                                                            <h3>A Section Subtitle</h3>

                                                            <p>Write one or two paragraphs describing your product or
                                                            services. To be successful your content needs to be useful to
                                                            your readers.</p>

                                                            <p>Start with the customer – find out what they want and give
                                                            it to them.</p>
                                                        </div>

                                                        <div class="col-md-6 mt16"><img alt="Odoo text and image block"
                                                        class="img img-responsive shadow mb16" src=
                                                        "/website/static/src/img/text_image.png"/></div>
                                                    </div>
                                                </div>
                                            </section>
                                        </div>
                                        <div role="tabpanel" class="oe_structure oe_empty tab-pane" id="tab3">
                                            <!-- Image-Text snippet -->
                                            <section class="mt16 mb16">
                                                <div class="container">
                                                    <div class="row">
                                                        <div class="col-md-6 mt16"><img alt="Odoo image and text block"
                                                        class="img img-responsive shadow mb16" src=
                                                        "/website/static/src/img/image_text.jpg"/></div>

                                                        <div class="col-md-6 mt16">
                                                            <h3>A Section Subtitle</h3>

                                                            <p>Write one or two paragraphs describing your product,
                                                            services or a specific feature. To be successful your content
                                                            needs to be useful to your readers.</p>

                                                            <p>Start with the customer – find out what they want and give
                                                            it to them.</p>
                                                        </div>
                                                    </div>
                                                </div>
                                            </section>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
Read more ...